User forums > Using Code::Blocks
Error when linking .res files
carra:
I was trying to use a compiled resource file (.res). Adding it to the project everything worked as expected: the file was selected for linking but nor for compiling. But it seems that, when C::B generates the command line to link it, it is somehow outputting a wrong path. I get the following:
File name (absolute) C:\Programacion\KTools\Objects\Resources\ChoiceBoxDialog.res
File name (relative) ..\..\Objects\Resources\ChoiceBoxDialog.res
Linking error:
\Programacion\KTools\Objects\Objects\Resources\ChoiceBoxDialog.res
No such file or directory
As you see, it has for some reason duplicated the Objects folder. I have verified that it is also being sent to the command line with that path. I don't really get why, since the path is correct in the project data. Any idea why??
PD: This happens in C::B nightly 8059
carra:
I have attached here a minimal project (only an empty winmain) that reproduces this. Tested in 8059, I get the following:
Paths in project settings:
Objects output dir: ..\Objects
Resource relative path: ..\Resources\InputBoxDialog.res
Paths in command line:
Path in build error message: ..\Objects\Resources\InputBoxDialog
Complete linker command line: g++.exe -L. -LC:/Programacion/KTools\Libraries -o ..\Binaries\InputBoxTest.exe ..\Objects\Project\InputBoxMain.o ..\Objects\Resources\InputBoxDialog.res -s -static-libgcc -static-libstdc++
It's worth noting that there is no linking problem when the project uses instead the .RC resource script and compiles it itself. But when using the .RES file to link directly, it seems to "assume" somehow that it comes from a previous compiling step. I'd say it's trying to adapt the path to the structure of subfolders used by GCC when placing object files (as jens describes here http://forums.codeblocks.org/index.php/topic,16467.msg111740.html#msg111740 ).
MortenMacFly:
--- Quote from: carra on July 12, 2012, 04:59:28 pm ---Any idea why??
--- End quote ---
Not without a minimal sample to reproduce.
carra:
You mean like the one I attached 1 minute before your post? Hehehe ;D
MortenMacFly:
--- Quote from: carra on July 13, 2012, 09:50:03 am ---You mean like the one I attached 1 minute before your post? Hehehe ;D
--- End quote ---
Yes, out posts crossed.
I inspected what you had provided, but I don't understand: You have included a binary (already compiled) resource file. Usually you are supposed to add the source (*.rc) file and have C::B to compile it.
Do you really want to just link against this binary resource file? Why don't you add it as a linker option then?
Navigation
[0] Message Index
[#] Next page
Go to full version