User forums > General (but related to Code::Blocks)

Directories for object files

<< < (3/3)

mandrav:

--- Quote ---If you design your project directories as cb, than there is no problem. I think that is the reason you
don't know about the problem?
--- End quote ---

I build other project too ;)

Take, for example, the rendering engine OGRE. I 've built this using CB. Here is a rough directory structure:

--- Code: ---
ogrenew <-- top dir
  Build <-- I created this dir to put all build files in
  OgreMain
    include
    src <-- main DLL source dir
    scripts <-- project files for VC. This is where OgreMain.cbp resides ;)
  ... <-- more directories with other DLLs source files

--- End code ---

In the CB project, I have two targets: Debug and Release. These are the build dirs defined for those targets:

--- Code: ---
Debug objects: ..\..\Build\Debug
Debug deps: ..\..\Build\.deps
Release objects: ..\..\Build\Release
Release deps: ..\..\Build\.deps

--- End code ---

Let me note here that all relative paths in CB are relative to the project file (.cbp)

When I build OgreMain.cbp (the Release target), the Build directory has the following structure:

--- Code: ---
ogrenew <-- top dir
  Build <-- I created this dir to put all build files in
    Release <-- this is the main build dir for the Release target
      OgreMain
        src <-- this dir is filled with object files
  OgreMain
    include
    src <-- main DLL source dir
    scripts <-- project files for VC. This is where OgreMain.cbp resides ;)
  ... <-- more directories with other DLLs source files

--- End code ---


Do you see something wrong with the above?
I don't ;)

Something just came to my mind: I always use the "direct-mode" for building, i.e. no GNU make. Maybe there is a bug there? I 'll have to check.
Have you tried building your project using "direct-mode"? Are your results the same?

Yiannis.

hd:
Hi again!

-
--- Quote --- I build other project too
--- End quote ---

You should not! Drop all projects but cb now! :)

- I'm using "direct-mode" also
- My configuration is gcc-3.4.2, wx2.5.4, xp
- I recreated the project simulating your structure, but result is not as yours !?
- Interesting but I can see "normal" behaivour when compiling cb itself

There should be something stupid..maybe it's me :(


For your reference I'm pasting compiler's linking release target log:

mingw32-g++.exe   -L"C:\\MinGW\\lib"  -L"..\\..\\..\\..\\wx25\\lib\\gcc_lib" -L"..\\..\\..\\..\\lua\\lib" -o "adret-gc_release.exe" ".orgc\\..\\..\\..\\_lib\\LocaleUtils.o" ".orgc\\..\\..\\..\\_lib\\Lua_I18N.o" ".orgc\\..\\..\\..\\_lib\\Lua_Interpreter.o" ".orgc\\..\\..\\..\\_lib\\Lua_wxDialog.o" ".orgc\\..\\..\\..\\_lib\\Lua_wxSQLite.o" ".orgc\\..\\..\\..\\_lib\\Reporter.o" ".orgc\\..\\..\\..\\_lib\\dbadaptr.o" ".orgc\\..\\..\\..\\_lib\\dbfind.o" ".orgc\\..\\..\\..\\_lib\\toggle.o" ".orgc\\..\\..\\..\\_lib\\wxsqlite.o" ".orgc\\..\\..\\AboutDialog.o" ".orgc\\..\\..\\AddressEdit.o" ".orgc\\..\\..\\AdretApp.o" ".orgc\\..\\..\\AdretWin.o" ".orgc\\..\\..\\LabelSetup.o" ".orgc\\..\\..\\dbAddress.o"  ".orgc\\..\\..\\resources.res"     -Wl,--subsystem,windows -mwindows    -llua -llualib -lwxmsw25 -lwxmsw25_stc -lwxexpat -lwxjpeg -lwxpng -lwxregex -lwxtiff -lwxzlib -lrpcrt4 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lole32 -loleaut32 -luuid -mwindows


Sorry for noise...

--
Regards,
Hakki Dogusan

chikigai:
Adding to the subject, I'd like to explain an issue I am experiencing with CodeBlocks V1.0.
Here is a layout of a simple project I am working on:

ASL
├─Project          <--- Project & Makefile files reside
│  └─GCC          <--- DLL output resides
│      ├─.deps     <--- Dependency files reside
│      └─.objs      <--- Object files resides
└─Work             <--- Source/header files reside


*** Using Direct Mode ***
When I originally created the project and compiled, the object files were outputted to "ASL/Project/GCC/.objs/Work" which was automatically created by CodeBlocks.
This is despite the fact I specified the output directory to "ASL/Project/GCC/.objs" in the target options.

After a quick look around, I found that the 'Advanced' tab in the properties of each source file contained "Work/<src_name>.o".
I deleted the "Work/" portion of each source file property and this resulted in the object files outputted to the correct directory "ASL/Project/GCC/.objs".

However, when I add/remove a source file from the project, CodeBlocks changes the option of each source file back to "Work/<src_name>.o".

Am I doing something wrong here?


*** Using a Custom Makefile ***
When compiling a specific Build Target, the target name is passed to Make.
This is fine.
However, when compiling a specific Source File, "../Work.objs/<src_name>.c" is passed to Make.

I have looked around to spot why CodeBlocks is inserting the ".objs" in the path but have had no success.

Profic:
All is right here. (Direct mode)
Suppose you fave two file with similiar name but in different directories - objects for them will overwrite each other. This thing annoys me in Dev-C++.

Moreover is it really important were object files are reside? C::B manage paths properly and generate dll/exe in proper directory. Isn't is enough?

Navigation

[0] Message Index

[*] Previous page

Go to full version