User forums > Using Code::Blocks
compiles fine in command prompt, but code blocks complains
Biplab:
While adding files, please check the targets. If a file is not added to a target, it will not compile.
darkwalk:
I knew it was something stupid that I'm doing. I checked the "Release" checkbox and not the "Debug" checkbox while importing a file. I reimported everything, checking all of the check boxes and it worked. I don't remember having those options on the previous version of code blocks. Is it new?
killerbot:
indeed when you add sources to the project, you have to select the targets you want them to belong to !!
Open up your project file (cbp with an editor),have a look at the sources part in the bottom. This is what was in your original cbp file :
--- Quote --- <Unit filename="main.cpp" />
--- End quote ---
How does it look for yours.
In the Unit tag the targets to which it belongs to can be explicitly specified, if like in this exmaple for main.cpp nothing is specified it means it belongs to all the targets.
darkwalk:
I just want to thank everyone who helped:
Biplab
killerbot
MortenMacFly
darkwalk:
<How does it look for yours.>
yea, it looks correct now:
</Compiler>
<Unit filename="main.cpp" />
<Unit filename="printStuff.cpp">
<Option target="Release" />
</Unit>
<Unit filename="printStuff.h">
<Option target="Release" />
</Unit>
All three files are included. Thanks!
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version