See the error messages and the corresponding region yourself :
I thought the preprocessor eliminates the comments...Is there an exception for "int main()" ?
This is a discussion on An Unusual Error (pointing at a commented out region !!) within the C++ Programming forums, part of the General Programming Boards category; See the error messages and the corresponding region yourself : I thought the preprocessor eliminates the comments...Is there an exception ...
See the error messages and the corresponding region yourself :
I thought the preprocessor eliminates the comments...Is there an exception for "int main()" ?
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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..
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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..
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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 .
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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 ?
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !
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
Manasij Mukherjee | gcc-4.8.0 @Arch Linux
Slow and Steady wins the race... if and only if :
1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !