User forums > Help
Put all the .o files in an "obj" subdirectory
jank9201:
It seems there is problem that the paremters of g++ contains too many characters and the linker stopped the creation of the DLL.
My question is:
for example, I have a directory structure like this:
src
- Foo.cpp
- Bar.cpp
test
- FooTest.cpp
- BarTest.cpp
- Main.cpp
By using Code::blocks, is there a way
putting all the .o files in an "obj" subdirectory of the "test" directory?
MortenMacFly:
--- Quote from: jank9201 on July 02, 2012, 10:10:16 am ---putting all the .o files in an "obj" subdirectory of the "test" directory?
--- End quote ---
Yes, just setup the object output folder accordingly in your project settings.
jank9201:
--- Quote from: MortenMacFly on July 02, 2012, 10:57:04 am ---
--- Quote from: jank9201 on July 02, 2012, 10:10:16 am ---putting all the .o files in an "obj" subdirectory of the "test" directory?
--- End quote ---
Yes, just setup the object output folder accordingly in your project settings.
--- End quote ---
Thanks your replay, while I had a try for several times, it seem no any changes, currently, I set objects output dir: test, it always create a main.o file and put it into test directory, and foo.o and bar.o into src directory. my intention is all objects file is put in test directory and there are no any subdirectory in test directory. how to setup, or could you give an example?
jank9201:
--- Quote from: jank9201 on July 02, 2012, 11:54:14 am ---
--- Quote from: MortenMacFly on July 02, 2012, 10:57:04 am ---
--- Quote from: jank9201 on July 02, 2012, 10:10:16 am ---putting all the .o files in an "obj" subdirectory of the "test" directory?
--- End quote ---
Yes, just setup the object output folder accordingly in your project settings.
--- End quote ---
Thanks your replay, while I had a try for several times, it seem no any changes, currently, I set objects output dir: test, it always create a main.o file and put it into test directory, and foo.o and bar.o into src directory. my intention is all objects file is put in test directory and there are no any subdirectory in test directory. how to setup, or could you give an example?
--- End quote ---
Can anybody help me?
cacb:
--- Quote from: jank9201 on July 11, 2012, 12:29:38 pm ---Can anybody help me?
--- End quote ---
See attached.
Select the project in C::B, riight-click and choose "Properties ...", then select the Build targets tab. You can then set the output dir for each target to anything you want. I chose to collect all under a "hidden" .cmp folder, and then have subdirs for different compilers (some of my projects can use different compilers on the same platform).
it is also possible to edit the .cbp project file for things like this (if you know what you are doing), here is a snippet
--- Code: --- ...
<Build>
<Target title="MSVC_Debug">
<Option output=".cmp\msvc\bin\Debug\cf_xmld" prefix_auto="1" extension_auto="1" />
<Option object_output=".cmp\msvc\obj\Debug\" />
<Option type="3" />
<Option compiler="msvc" />
--- End code ---
...
Navigation
[0] Message Index
[#] Next page
Go to full version