Code::Blocks Forums
User forums => Help => Topic started by: Atrixium on September 06, 2011, 07:26:43 pm
-
Okay, so I have a weird one. This may be a bug, or it might be an RTFM issue, I hope it's not because i've been combing this site and the wiki for even the slightest hint since Friday and I've come up empty.
Here's the situation:
When I compile my simple C++ Roguelike and link with the Curses library using the build and run function in Code::Blocks, I end up with text that's white on black even though I'm expecting colours. Thinking it might be the Code::Blocks console failing to display colour, I tried it in terminal and it is indeed white on black.
When I compile from the terminal (g++ main.cpp -L/usr/lib -lcurses -o test) I get all the colours I'm expecting.
I've checked my settings to make sure that Code::Blocks is pointing the linker to the right library and the compiler doesn't have any flags set. I tried removing and reinstalling Code::Blocks (I'm running 10.05 Debian Binary Release) and it had no effect.
I am now thoroughly stumped, is there anyway to see what command line options Code::Blocks is passing to g++?
Any help would be greatly appreciated!
-
Make CB produce a log for every compilation:
Settings | Compiler & Debugger.. | Build Options
And then make sure that the "Save build log to HTML" and "Always output full command line" options are checked. This will write a build log, with compiler options, into your project directory for every compilation, so you can see exactly what has happened.
-
Much more usable:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [your compiler] -> Other settings (rightmost tab) -> Compiler logging:" to "Full commandline".
This will not be saved, but is instantly visible in "Build log".
-
@Jens Is there some reason why one or the other of these is not switched on by default?
-
Thanks for the replies, I was able to solve it after turning on logging.
I compiled and linked with the commands it was using and slowly removed options until the issue disappeared, it turned out to be a bad include that was including a different header file than the one I was expecting, modifying my search directories for the compiler fixed it!
@Neil I was unable to find the option you directed me to but stumbled upon the "Other Settings" section that jens mentioned myself while trying to find it. Even looking now I can't seem to find the Build Options section, maybe it was removed in 10.05?
Thanks again for the help, Code::Blocks rocks! :D
-
> I was unable to find the option you directed me to but stumbled upon the "Other Settings" section that jens mentioned myself while trying to find it. Even looking now I can't seem to find the Build Options section, maybe it was removed in 10.05?
More likely it was added after 10.05 - I use a recent nightly.
-
In 10.05 it's in "Settings -> Compiler and debugger... -> Global compiler settings -> [your compiler] -> Other settings (rightmost tab)".
Check "Save build log to HTML..." and the checkbox below.