Hi,
what are the switches (does exists some?) to prevent from the following problem:
This is the Project File, which builds a static lib from 3rd party sources:
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
...
<Target title="Release">
<Option output="librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
...
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c"><Option compilerVar="CC" /></Unit>
...
On build I get the error request dialog:
Can't build object output directory \\build\debug\C\Programme\MATLAB\R2007a\rtw\c\libsrc
The object should go into build\debug directory and not on the full path of the source!
Thanks,
Olaf
See the Project -> Properties menu
Tab "Build Targets"
Select correct target
See what in box "output file name"
Tim S
you mean this?
(http://img406.imageshack.us/img406/6870/librtwcbpsettingszi4.th.png) (http://img406.imageshack.us/my.php?image=librtwcbpsettingszi4.png)
Thanks,
Olaf
Yes that is the correct place.
Note, I have .objs for "Objects output dir" this is for temp file, not the file output.
Try "output file name" with "build\debug\librtw.a"
Tim S
Thanks, it seems to be a bug in C::B!
Here the error again:
(http://img241.imageshack.us/img241/1192/cbprtliberrorbu8.th.png) (http://img241.imageshack.us/my.php?image=cbprtliberrorbu8.png)
Interesting gcc's Messages about output path , source and objects are on different (window) drives:
(http://img98.imageshack.us/img98/497/cbprtlibgccmsgvy6.th.png) (http://img98.imageshack.us/my.php?image=cbprtlibgccmsgvy6.png)
On the same driver I get this
(http://img54.imageshack.us/img54/8339/cbprtlibgccmsg2ti8.th.png) (http://img54.imageshack.us/my.php?image=cbprtlibgccmsg2ti8.png)
Interesting it does compile, well, but the object path is stripped correctly. Isn't this a bug?
Thanks,
Olaf
Quote from: ope on August 31, 2007, 07:20:33 AM
Thanks, it seems to be a bug in C::B!
No, it seems to be a bug in your project setup, honestly. I tried to reproduce what you have said - it works perfectly. If you want further assistence please post a minimal project as an example. You can strip down the code but leave the project file etc. as it is.
With regards, Morten.
Thanks for your answer. The build dir (where the project file is) is on d:\
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Test" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="default">
<Option output="default\libTest.a" prefix_auto="0" extension_auto="0" />
<Option working_dir="" />
<Option object_output="default" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Option createDefFile="1" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="-O2" />
<Add option="-fno-common" />
<Add option="-fno-short-enums" />
<Add option="-mcpu=tc1766" />
<Add directory="src" />
<Add directory="h" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1766" />
</Linker>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
</Extensions>
</Project>
</CodeBlocks_project_file>
The begin of the build log:
-------------- Build: default in Test ---------------
tricore-gcc.exe -Wall -g -O2 -fno-common -fno-short-enums -mcpu=tc1766 -g -Isrc -Ih -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o default\C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o
Thanks,
Olaf
Olaf: There has been people who stated they had issues using MinGW GCC with code on a different drive.
I assume that this would be an MinGW issue and not an C::B issue.
Tim S
Quote
Olaf: There has been people who stated they had issues using MinGW GCC with code on a different drive.
I assume that this would be an MinGW issue and not an C::B issue.
For this I added C::B's generated command line. The object path isn't correct for some reasons. Also of interest:
(http://img230.imageshack.us/img230/2970/cbversf7.th.png) (http://img230.imageshack.us/my.php?image=cbversf7.png)
Anyway, this is the build from http://www.hightec-rt.com (http://www.hightec-rt.com) using with the TriCORE gcc.
Thanks,
Olaf
This bug has been fixed in revision 4036. Please download a latest nightly build. This is the reason we are unable to reproduce this.
Please Note: This bug has been fixed by specifying the full path of the source file in case the relative path creation fails. So in your case the objective files will be created inside C:\Programme\MATLAB\R2007a\rtw\c\libsrc\ folder.
If you don't like that then you'll need to copy the source files to the drive where your project file exists.
Hi,
I'm using svn release 4417 for now. Anyway, it builds the object files inside the source directory!
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -IC:\Programme\MATLAB\R2007a\rtw\c\libsrc -I"D:\Dokumente und Einstellungen\olpetzol\Eigene Dateien\MATLAB\phycore1775_led_tricore_ert" -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o
...
I would expect the object files located relative to the project directory as the project settings suggest:
(http://img154.imageshack.us/img154/6466/rtwprjph3.th.png) (http://img154.imageshack.us/my.php?image=rtwprjph3.png)
And now: the real confusing:
...
tricore-ar.exe -rs build\debug\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Release in rtwlib ---------------
tricore-ar.exe -rs librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
The lib builds/created twice, in the project's defined directory and the current (c::b project's) directory!
Did I missunderstand something or is the bug not fixed correctly (maybe another one)?
Thanks
Olaf
Quote from: ope on September 03, 2007, 10:01:01 AM
I'm using svn release 4417 for now. Anyway, it builds the object files inside the source directory!
I wrote it earlier that in case the source file is in different drive, the object file would be build at the source location.
Quote from: ope on September 03, 2007, 10:01:01 AM
I would expect the object files located relative to the project directory as the project settings suggest:
If the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.
Quote from: ope on September 03, 2007, 10:01:01 AM
And now: the real confusing:
...
tricore-ar.exe -rs build\debug\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Release in rtwlib ---------------
tricore-ar.exe -rs librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
The lib builds/created twice, in the project's defined directory and the current (c::b project's) directory!
Did I missunderstand something or is the bug not fixed correctly (maybe another one)?
It's not created twice. Rather both of your targets are being built at the same time.
QuoteIf the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.
I would expect make/Makefile behavior!
QuoteIt's not created twice. Rather both of your targets are being built at the same time.
The effect is, that two libs are created! One in build\debug\librtw.a and one inside the work directory; since the depency is related to librtw.a in the work/project directory, the release target (from virtual "all") will not be created!
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rtwlib" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="Debug">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<Add directory="." />
<Add directory="C:\Programme\MATLAB\R2007a\rtw\c\libsrc" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.c"><Option compilerVar="CC" /></Unit>
<Extensions>
<code_completion />
</Extensions>
</Project>
</CodeBlocks_project_file>
Regards,
Olaf
Quote from: ope on September 04, 2007, 07:26:44 AM
QuoteIf the source directory is in different drive, the relative path creation fails and it uses the full path instead. This is currently hard-coded. But this can be changed.
I would expect make/Makefile behavior!
Please post one such working example.
Quote from: ope on September 04, 2007, 07:26:44 AM
The effect is, that two libs are created! One in build\debug\librtw.a and one inside the work directory; since the depency is related to librtw.a in the work/project directory, the release target (from virtual "all") will not be created!
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rtwlib" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="Debug">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<Add directory="." />
<Add directory="C:\Programme\MATLAB\R2007a\rtw\c\libsrc" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.c"><Option compilerVar="CC" /></Unit>
<Extensions>
<code_completion />
</Extensions>
</Project>
</CodeBlocks_project_file>
Sorry I couldn't understand your point. Which is dependent and on whom??
The workspace:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="phycore1775_led">
<Project filename="phycore1775_led.cbp" active="1" >
<Depends filename="RTW_lib.cbp" />
</Project>
<Project filename="RTW_lib.cbp" />
</Workspace>
</CodeBlocks_workspace_file>
The project self:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="phycore1775_led" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Option virtualFolders="RTW\;" />
<Build>
<Target title="Debug">
<Option output="binaries\phycore1775_led_dbg.elf" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="1" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
<Linker>
<Add library="build\debug\librtw.a" />
</Linker>
</Target>
<Target title="Release">
<Option output="binaries\phycore1775_led.elf" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="1" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
<Add library="build\release\librtw.a" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<!--
XXX This is the same as defines.txt; move to function
-->
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<!--
where to find RTW's libsrc and rtwtypes.h
-->
<Add directory="." />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<!-- Sources -->
<Unit filename="tcboard_main.c"><Option compilerVar="CC" /></Unit>
<Unit filename="rtwtypes.h" />
<Unit filename="phycore1775_led.c"><Option compilerVar="CC" /></Unit>
<Unit filename="phycore1775_led.h" />
<Unit filename="phycore1775_led_data.c"><Option compilerVar="CC" /></Unit>
<Unit filename="phycore1775_led_private.h" />
<Unit filename="phycore1775_led_types.h" />
<!-- RTW specific stuff -->
<Unit filename="phycore1775_led.rtw"><Option virtualFolder="RTW\" /></Unit>
<Unit filename="rtw_proj.tmw"><Option virtualFolder="RTW\" /></Unit>
<!-- Other generated stuff -->
<Unit filename="defines.txt" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
The library depend on:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="rtwlib" />
<Option pch_mode="2" />
<Option compiler="tricoregcc" />
<Build>
<Target title="Debug">
<Option output="build\debug\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\debug" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="build\release\librtw.a" prefix_auto="0" extension_auto="0" />
<Option object_output="build\release" />
<Option type="2" />
<Option compiler="tricoregcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<VirtualTargets>
<Add alias="All" targets="Debug;Release;" />
</VirtualTargets>
<Compiler>
<Add option="-mcpu=tc1775" />
<Add option="-O2" />
<Add option="-fno-short-enums" />
<Add option="-fno-common" />
<Add option="-W" />
<Add option="-Wall" />
<Add option="-g" />
<!--
XXX This is the same as defines.txt; move to function
-->
<Add option="-DERT=1" />
<Add option="-DMODEL=phycore1775_led" />
<Add option="-DNUMST=1" />
<Add option="-DNCSTATES=0" />
<Add option="-DHAVESTDIO" />
<Add option="-DADD_MDL_NAME_TO_GLOBALS=1" />
<Add option="-DONESTEPFCN=1" />
<Add option="-DTERMFCN=1" />
<Add option="-DMAT_FILE=0" />
<Add option="-DMULTI_INSTANCE_CODE=0" />
<Add option="-DINTEGER_CODE=0" />
<Add option="-DMT=0" />
<Add option="-DMULTITASKING=0" />
<Add option="-DTID01EQ=0" />
<!--
where to find RTW's libsrc and rtwtypes.h
-->
<Add directory="." />
<Add directory="C:\Programme\MATLAB\R2007a\rtw\c\libsrc" />
</Compiler>
<Linker>
<Add option="-Wl,--Map,map.txt" />
<Add option="-mcpu=tc1775" />
</Linker>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.c"><Option compilerVar="CC" /></Unit>
<Unit filename="C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.c"><Option compilerVar="CC" /></Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>
The build log:
-------------- Build: Debug in rtwlib ---------------
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -IC:\Programme\MATLAB\R2007a\rtw\c\libsrc -c C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.c -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o
...
tricore-ar.exe -rs build\debug\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Release in rtwlib ---------------
tricore-ar.exe -rs build\release\librtw.a C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrc_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_dbl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubrr_sgl.o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_dbl.o
-------------- Build: Debug in phycore1775_led ---------------
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c phycore1775_led_data.c -o build\debug\phycore1775_led_data.o
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c tcboard_main.c -o build\debug\tcboard_main.o
tricore-gcc.exe -mcpu=tc1775 -O2 -fno-short-enums -fno-common -W -Wall -g -DERT=1 -DMODEL=phycore1775_led -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DADD_MDL_NAME_TO_GLOBALS=1 -DONESTEPFCN=1 -DTERMFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0 -DMULTITASKING=0 -DTID01EQ=0 -g -I. -c phycore1775_led.c -o build\debug\phycore1775_led.o
tricore-g++.exe -o binaries\phycore1775_led_dbg.elf build\debug\phycore1775_led_data.o build\debug\tcboard_main.o build\debug\phycore1775_led.o -Wl,--Map,map.txt -mcpu=tc1775 build\debug\librtw.a
...
a) The objects of the library are not inside the given object_output object dir (target depend)
b) Therefore the release target lib is build on debug build objects
The Problem is related to gcc's outfile option -o C:\Programme\MATLAB\R2007a\rtw\c\libsrc\rt_backsubcc_sgl.o which should be
-o build\debug\rt_backsubcc_sgl.o as the binary output object directory tag promised - regardless if the source point to windows drive c:\ and/or the build is on drive d:\
The same with the ar command line.
It seems the path from source files are not stripped correctly for object files.
Regards,
Olaf
Hi,
I had been able to reproduce the behavior with the static lib wizard of Code::Blocks. The problem is, if the project file .cbp and the sources of the project are on different drives. In the attached file the project static_lib/static_lib.cbp is on e.g C:\temp\static_lib and the source file main.c on a network drive r:\tausch\mario\testx. The output directory in the project file is configured as build\Debug but instead of generating objects in object output dir C:\temp\static_lib\build\Debug they are generated in the source directory r:\tausch\mario\testx.
[attachment deleted by admin]
Quote from: mariocup on September 04, 2007, 03:49:48 PM
I had been able to reproduce the behavior with the static lib wizard of Code::Blocks. The problem is, if the project file .cbp and the sources of the project are on different drives. In the attached file the project static_lib/static_lib.cbp is on e.g C:\temp\static_lib and the source file main.c on a network drive r:\tausch\mario\testx. The output directory in the project file is configured as build\Debug but instead of generating objects in object output dir C:\temp\static_lib\build\Debug they are generated in the source directory r:\tausch\mario\testx.
I wrote this earlier that this behaviour is hard-coded.
IMHO, the fallback code should create the relative path of object file to C:\temp\static_lib\build\Debug\r\tausch\mario\testx.
There is only one, but a nasty, problem. In C::B every plugin handles file path creation/manipulation on it's own. I'm not sure if I make such changes, other parts would function normally or not.
I'll try to fix this issue. :)
I've changed the object output creation of source files residing in different drive. Now the object files will be created inside the project's object output directory.
Example:
* Project object output dir: C:\Foo\obj\Debug
* Source: D:\Source\foo.cpp
* Obj file: C:\Foo\obj\Debug\D\Source\foo.o
I made some tests and it works well. It's in revision 4424.
@Mario and Ope,
Can you please test it with your projects to see if it's working well?? :)
Hi Biplab,
I will try it and give you feedback tomorrow. Thx. :D
Hi Biplab,
I have tested svn 4427 and TARGET_OUTPUT_DIR works fine for me. Thx again.
Related to the TARGET_OUTPUT_FILE there is also a strange behaviour we discussed in http://forums.next.codeblocks.org/index.php/topic,6556.0.html. It seems that codeblocks does not get the TARGET_OUTPUT_FILE correctly if different projects are opened, although the build works for the active target. Even a rebuild of a project will not fix the problem. Is there a workaround for this problem?
Quote from: mariocup on September 06, 2007, 01:11:45 PM
Related to the TARGET_OUTPUT_FILE there is also a strange behaviour we discussed in http://forums.next.codeblocks.org/index.php/topic,6556.0.html. It seems that codeblocks does not get the TARGET_OUTPUT_FILE correctly if different projects are opened, although the build works for the active target. Even a rebuild of a project will not fix the problem. Is there a workaround for this problem?
I'm aware of this issue and you've submitted a bug-report earlier. I tried to fix that sometimes back. But I couldn't find a proper solution to this problem. I'll try to fix that. :)
Hi,
the build works now!
Thanks,
Olaf