User forums > Using Code::Blocks

Can't find #include files

(1/2) > >>

simonl:
I've just installed C::B and tried to transfer some existing code to it.  I split it into two projects:

lib      - builds a library which is used by ...

tests  which consists of s set of separate, single file programs which test various aspects of the lib and which depends upon it.


The lib build worked fine first time (congrats to C::B team - a very professional product).  The tests project dependency works fine.

The test programs use the same headers as the lib project so I added the header directory to project tests Properties ... -> c/c++ parser options as an additional search path.  Just to be doubly sure I added it to the Build options... ->search directories->compiler  tab (I'm not yet sure what the difference is between the two places).  But it doesn't find the include files.  

I turned full logging on and the g++ command for the first test is:

mingw32-g++.exe   -c P:\eacp\test\polydomaintest.cpp -o \polydomaintest.o

I'd expect it to also have:   -Ip:\eacp\include 

Also what's with -o \polydomaintest.o ... shouldn't it be -o .\polydomaintest.o or just -o polydomaintest.o

Any ideas what I'm doing wrong?

Thanks

Simon

MortenMacFly:

--- Quote from: simonl on November 28, 2008, 07:33:38 pm ---Any ideas what I'm doing wrong?

--- End quote ---
Please post your project file and we most likely can tell.

simonl:
Thanks for the quick reply.  Here's the "test" project file. 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="6" />
   <Project>
      <Option title="test" />
      <Option platforms="Windows;" />
      <Option pch_mode="2" />
      <Option compiler="gcc" />
      <Build>
         <Target title="Debug">
            <Option type="4" />
            <Option compiler="gcc" />
            <Option projectIncludeDirsRelation="2" />
            <Compiler>
               <Add option="-g" />
               <Add directory="P:\eacp\include" />
               <Add directory="..\include" />
            </Compiler>
         </Target>
         <Target title="Release">
            <Option output="bin\Release\test" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj\Release\" />
            <Option type="1" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-O2" />
               <Add directory="P:\eacp\include" />
            </Compiler>
            <Linker>
               <Add option="-s" />
            </Linker>
         </Target>
      </Build>
      <Compiler>
         <Add option="-Wall" />
         <Add directory="P:\eacp\include" />
         <Add directory="..\include" />
      </Compiler>
      <Unit filename="intervalTest.cpp" />
      <Unit filename="polydomaintest.cpp" />
      <Unit filename="polytest.cpp" />
      <Unit filename="simpletest.cpp" />
      <Unit filename="traittest.cpp" />
      <Extensions>
         <code_completion>
            <search_path add="..\include" />
         </code_completion>
         <debugger />
      </Extensions>
   </Project>
</CodeBlocks_project_file>

Simon

Jenna:
Change projects "Properties... -> Build targets -> Debug -> Type" to "Console application" or whatever type it should be. Don't use "Commands only" !!

Btw. the "Release" build target seems to be correct.

simonl:
Thanks.  The project contains lots of separate programs - I'd guessed (wrongly) that "Commands Only" wouldn't try and link everything together.  Is it easier to just provide a make file to produce lots of exe files in one directory? Before trying C::B I tended to use ad hoc make files but thought maybe I wouldn't need then any more.

Simon
   

Navigation

[0] Message Index

[#] Next page

Go to full version