For some reason I am experiencing intermittent problems with the cache not being cleared.
For instance I experience problems when I change the code and recompile and run (for instance I will add a cout statement). When I run the new code I still get the old code output.
I have tried closing Dev C++ and reopening, running other programs, using compile/run, separate compile and run, opening new programs etc. (even downloaded another copy of Dev). And nothing seems to help. And I would say that this does not happen on every single program.
Any suggestions would be appreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
... which might not work for a number of reasons, but I wonder why the failure exhibited itself in such a strange way? I am not convinced that the problem was not unrelated, and that something else has changed. Can you reproduce the problem by reverting to the original code? Thoigh maybe since it is working you no longer care enough or have the time to try it.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Interestingly, you didn't mention the use of "Rebuild All", which is usually the first place to start at such times. You didn't mention whether you are sure you are saving your fileafter you make your changes. (Before getting offended, I will tell you I have been programming for almost 35 years now, and I do that every day or two, or modify a file in the wrong path)
You also managed to never mention what version of Dev you were using. That is kind of a head slapper - i.e. you should slap yourself on the head and say "How stupid of me to describe all the stuff I did, and never give the version number!!" - Loud slap
You also never mentioned whether, when you do your recompile, you see any messages that indicate that the compiler did not find anything new to do. If it is not saying so, then it is finding some new code to compile.
I would recommend posting your full Basic 3 for a compile, that would start to answer some of the questions so we can answer yours.
The Basic 3 are covered in the thread titled "Please Read Before Posting a Question"
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It is funny how often when faced with a problem some people seek out the most complex and unlikely explanation instead of the simplest and most obvious explanation. Rather than 'self-diagnose' let us see the symptoms for ourselves!
Asking us how how to solve the problem of clearing the cache is pointless, because it is nonsense. We have to see the diagnostic data before we can reach a more sensible conclusion.
I can guarantee that it has nothing to do with clearing the cache and everything to do with the build failing. That can happen for a number of reasons. Perform a "Rebuild All" and post the associated "Compile Log" and the chances are that we can figure it out.
The build can fail due to code error, and also if the executable is not writeable, which happens if it is still running, but that is not the only reason.
Clifford.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks guys for the responses. Obviously I am ignorant about all of this and not great on reading instructions :). I will study this and respond accordingly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It appears that I solved the problem. I am using Version 4
Mingw compiler 2.95, the new editions are quite slow. I did use Rebuild All with no effect.
The problem appears to be in the code I was using to hold the console open, using a simple cout and cin. In order to keep the console open, I changed the code to
cin.clear();
while (cin.get() != '\n') // loop until it eats the newline
;
cin.get();
return 0;
I would presume that this clears the buffer?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> Mingw compiler 2.95, the new editions are quite slow.
But the bugs in the older version will slow you down more! How much time has this one wasted for example, and what would have been the cumulaticve effect of a marginally slower build? Far less I'll bet.
Besides, if the difference is noticeably significant, there is something else wrong I suggest.
Also since no one who is likely to be able to assist with Dev-C++ specific issues here is using that version, you are kind of on your own - which may not be a problem, since you have found a solution in this case.
However without seeing what you originally had, I find it hard to see how this is a fix to the problem described. If you used system("pause"), then use the close box rather than pressing a key, I guess it could have left the exe locked, because the pause is executed in a child cmd process, but I don't think that happens in Dev-C++ 4.9.9.3/Mingw 3.4.2 as far as I know.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi: Thanks for taking time to answer my question:
For some reason I am experiencing intermittent problems with the cache not being cleared.
For instance I experience problems when I change the code and recompile and run (for instance I will add a cout statement). When I run the new code I still get the old code output.
I have tried closing Dev C++ and reopening, running other programs, using compile/run, separate compile and run, opening new programs etc. (even downloaded another copy of Dev). And nothing seems to help. And I would say that this does not happen on every single program.
Any suggestions would be appreciated!
Thanks Clifford:::
Actually I used something like:
int enter;
cout << " Enter a key to close window";
cin enter;
return 0;
... which might not work for a number of reasons, but I wonder why the failure exhibited itself in such a strange way? I am not convinced that the problem was not unrelated, and that something else has changed. Can you reproduce the problem by reverting to the original code? Thoigh maybe since it is working you no longer care enough or have the time to try it.
Clifford
Interestingly, you didn't mention the use of "Rebuild All", which is usually the first place to start at such times. You didn't mention whether you are sure you are saving your fileafter you make your changes. (Before getting offended, I will tell you I have been programming for almost 35 years now, and I do that every day or two, or modify a file in the wrong path)
You also managed to never mention what version of Dev you were using. That is kind of a head slapper - i.e. you should slap yourself on the head and say "How stupid of me to describe all the stuff I did, and never give the version number!!" - Loud slap
You also never mentioned whether, when you do your recompile, you see any messages that indicate that the compiler did not find anything new to do. If it is not saying so, then it is finding some new code to compile.
I would recommend posting your full Basic 3 for a compile, that would start to answer some of the questions so we can answer yours.
The Basic 3 are covered in the thread titled "Please Read Before Posting a Question"
Wayne
It is funny how often when faced with a problem some people seek out the most complex and unlikely explanation instead of the simplest and most obvious explanation. Rather than 'self-diagnose' let us see the symptoms for ourselves!
Asking us how how to solve the problem of clearing the cache is pointless, because it is nonsense. We have to see the diagnostic data before we can reach a more sensible conclusion.
I can guarantee that it has nothing to do with clearing the cache and everything to do with the build failing. That can happen for a number of reasons. Perform a "Rebuild All" and post the associated "Compile Log" and the chances are that we can figure it out.
The build can fail due to code error, and also if the executable is not writeable, which happens if it is still running, but that is not the only reason.
Clifford.
Thanks guys for the responses. Obviously I am ignorant about all of this and not great on reading instructions :). I will study this and respond accordingly.
It appears that I solved the problem. I am using Version 4
Mingw compiler 2.95, the new editions are quite slow. I did use Rebuild All with no effect.
The problem appears to be in the code I was using to hold the console open, using a simple cout and cin. In order to keep the console open, I changed the code to
cin.clear();
while (cin.get() != '\n') // loop until it eats the newline
;
cin.get();
return 0;
I would presume that this clears the buffer?
> Mingw compiler 2.95, the new editions are quite slow.
But the bugs in the older version will slow you down more! How much time has this one wasted for example, and what would have been the cumulaticve effect of a marginally slower build? Far less I'll bet.
Besides, if the difference is noticeably significant, there is something else wrong I suggest.
Also since no one who is likely to be able to assist with Dev-C++ specific issues here is using that version, you are kind of on your own - which may not be a problem, since you have found a solution in this case.
> I would presume that this clears the buffer?
That's one way. Another way (include <limits>):
std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
cin.get();
ref: http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.3
However without seeing what you originally had, I find it hard to see how this is a fix to the problem described. If you used system("pause"), then use the close box rather than pressing a key, I guess it could have left the exe locked, because the pause is executed in a child cmd process, but I don't think that happens in Dev-C++ 4.9.9.3/Mingw 3.4.2 as far as I know.
Clifford