See the error messages and the corresponding region yourself :
I thought the preprocessor eliminates the comments...Is there an exception for "int main()" ?
See the error messages and the corresponding region yourself :
I thought the preprocessor eliminates the comments...Is there an exception for "int main()" ?
is it possible that code::blocks doesn't automatically save your files before building. you comment the code out, but the version that the compiler sees is the one with the code uncommented. I can see that the file has not been saved, so that's my best guess.
No, I'm sure it saves automatically..
And the screenshot shows that because I probed around a little..scouring for the source of the error..
Anyway..I removed the "extra" int main()..and it works as it should...
But this has got to be the strangest error I've ever seen....and probably would ever see..
The error message says line 5, and there is a little * next to the filename in the tab title.
Did you save it before compiling?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
line 5 : is in another file(matrix.cpp)...which has the current main() function....the commented portion was for testing the token.cpp file separately .
Still, it looks unsaved to me (the * thing I mentioned).
If you're sure you have auto-save turned on, it might be worth checking C::B website / bug reports to see if there are any issues.
If you can reliably replicate it, then submit a bug report to them.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
O ...sorry.. I found the problem..
The token.cpp file was not from the current active project(It was #include'd but not added with C::B's gui )..so autosave did not work on it..It only saved the active files and started the compilation. Could absence of the configuration option to save all open files count as a bug ?
No it is a design decision; not a bug.
If you wish to waste your time, you can submit it as a bug and see it closed with no fix.
Tim S.
One might question why you're #including .cpp files.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
What? Of course you can add files to your project. Select the Project menu item, then select Add Files.because there isn't a way to add an external *.cpp to the compilation from the IDE without #include 'ing it.
Jim