Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Eureka on October 25, 2009, 11:59:03 am
-
Hello, I'm a very beginner in computer programming and I have two questions with C::B :
1. When the program starts compiling, I can see some blue-written messages (the warnings) but when the compilation is over, they are erased. The problem is that I don't have the time to read the warnings as the compilation is very fast. How can I fix that ?
2. Is there a way for C::B to warn me that I don't use a variable I declared ? How ?
-
To view the compiler messages, go to the View menu and select Logs. The messages will be under the Build Log and Build Messages tabs in the resulting window.
To get warnings about unused variables (and lots of other things), go to the Settings menu, choose Compiler & Debugger and then check Enable All Compiler Warnings in the Global Compiler Settings tab.
-
Thank you.
One thing: Logs was already selected, and as I said my warnings merely disappear once the program compiled. So what should I do ?
-
> my warnings merely disappear once the program compiled
Do you mean that the Log and Messages tabs are completely empty after a compilation or just that the warnings have disappeared? You should always have some messages in the Build Log and Messages tabs, if only to indicate succesful compilation.
I suppose now is also the time to ask which platform you are on and which version of CB you are using?
-
I'm using C::B 8.02 and I'm on Ubuntu 9.04.
Actually there's something remaining after the compilation :
Checking for existence: /home/Eureka/Prog/Test/bin/Debug/Test
Executing: xterm -T Test -e /usr/bin/cb_console_runner /home/Eureka/Prog/Test/bin/Debug/Test (in /home/Eureka/Prog/Test/.)
Process terminated with status 0 (0 minutes, 5 seconds)
-
You most likely have clicked Build and run and not only build.
-
OK, all is revealed - you are doing a build & run, which overwrites the compiler messages with the results of running your executable. You just need to do a Build only - select Build from the Build menu.
-
Well, if I do a build only, here's what I get :
-------------- Build: Release in Test ---------------
Target is up to date.
Nothing to be done.
Still no warnings =(
-
The warnings (unlike errors) will appear only the first time you successfully compile an executable. To see them again, to a Rebuild (also in the Build menu), or Compile CurrentFile, or make a minor change to the file(s) in question and do a normal Build.
-
The warnings will appear only the first time you successfully compile an executable. To see them again, to a Rebuild (also in the Build menu), or make a minor change to the file(s) in question.
Or clean the project, before build (does the same as rebuild, but you invoke the two steps manually).
-
All right I get the warnings.
Thanks to both of you!