News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

compiles fine in command prompt, but code blocks complains

Started by darkwalk, May 23, 2007, 03:43:35 PM

Previous topic - Next topic

Biplab

While adding files, please check the targets. If a file is not added to a target, it will not compile.
Be a part of the solution, not a part of the problem.

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" />

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!

killerbot

Quote from: darkwalk on May 23, 2007, 05:35:24 PM
<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!

well if it looks like you just posted, they are not part of the Debug target !!!

darkwalk

I think I didn't save the project before editing the cbp file. Does this look correct now:

      <Compiler>
         <Add option="-Wall" />
         <Add option="-fexceptions" />
      </Compiler>
      <Unit filename="main.cpp" />
      <Unit filename="printStuff.cpp" />
      <Unit filename="printStuff.h" />
      <Extensions>
         <code_completion />
      </Extensions>   

I created a new project and imported all the files using the "debug" and "release" check box.

killerbot