Author Topic: compiles fine in command prompt, but code blocks complains  (Read 12635 times)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: compiles fine in command prompt, but code blocks complains
« Reply #15 on: May 23, 2007, 05:22:14 pm »
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

  • Guest
Re: compiles fine in command prompt, but code blocks complains
« Reply #16 on: May 23, 2007, 05:27:02 pm »
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? 

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: compiles fine in command prompt, but code blocks complains
« Reply #17 on: May 23, 2007, 05:32:28 pm »
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

  • Guest
Re: compiles fine in command prompt, but code blocks complains
« Reply #18 on: May 23, 2007, 05:32:36 pm »
I just want to thank everyone who helped:

Biplab
killerbot
MortenMacFly

darkwalk

  • Guest
Re: compiles fine in command prompt, but code blocks complains
« Reply #19 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!

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: compiles fine in command prompt, but code blocks complains
« Reply #20 on: May 23, 2007, 05:44:18 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

  • Guest
Re: compiles fine in command prompt, but code blocks complains
« Reply #21 on: May 23, 2007, 05:51:13 pm »
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.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: compiles fine in command prompt, but code blocks complains
« Reply #22 on: May 23, 2007, 05:55:10 pm »
perfect.

ENJOY CODE::BLOCKS !!!!!