User forums > Using Code::Blocks
Relative path to libraries does not link [SOLVED]
Edis Krad:
I have a static library placed in the same directory where the project is. I go to Projects->Build Options, then click on the Linker tab, add the library, and when it asks me if I want to use the relative path, I choose "yes".
I have no problems compiling at all, but when the linker runs, it complains it can't find the library. The only way I found to solve this is by telling Code::Blocks to to keep the path absolute, which is sort of annoying because I have to mirror the complete directory structure starting from root (or change the project properties) each time I want to compile it in another computer. (Something I have to do often, by the way)
Does anybody know what I might be failing to do?
mandrav:
Enable the full build log (in Settings->Compiler and debugger->[select your compiler]->Other) and post it here.
kidmosey:
did you go to "Settings->Compiler and Debugger->Global Compiler Settings->Other" and check one/both of the boxes for explicitly adding the current directory to search dirs?
[edit]
--- Quote from: mandrav on August 01, 2006, 08:54:43 am ---Enable the full build log (in Settings->Compiler and debugger->[select your compiler]->Other) and post it here.
--- End quote ---
This isn't the default setting yet?
[/edit]
kkez:
I've had the same problem, and i solved it this way: enter the library full name (eg libsomething.a or something.lib) and then prepend it with these two chars: .\ so the resulting filename will be .\libsomething.a or .\something.lib.
Edis Krad:
To answer everyone at once....
--- Quote from: mandrav on August 01, 2006, 08:54:43 am ---Enable the full build log (in Settings->Compiler and debugger->[select your compiler]->Other) and post it here.
--- End quote ---
--- Code: ----------------- Build: Debug in LaserControl ---------------
mingw32-g++.exe -Wall -g -IC:\MinGW\include -c textwriter.cpp -o obj\Debug\textwriter.o
mingw32-g++.exe -LC:\MinGW\lib -o bin\Debug\LaserControl.exe obj\Debug\bezier.o obj\Debug\bufferednode.o obj\Debug\clipper.o obj\Debug\commandbuffer.o obj\Debug\main.o obj\Debug\normalizeintensity.o obj\Debug\pipelinenode.o obj\Debug\sc2000.o obj\Debug\textwriter.o -lfreetype.a
C:\Developement\MinGW\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lfreetype.a
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
--- End code ---
--- Quote from: kidmosey on August 01, 2006, 01:17:41 pm ---did you go to "Settings->Compiler and Debugger->Global Compiler Settings->Other" and check one/both of the boxes for explicitly adding the current directory to search dirs?
--- End quote ---
That's for the compiler, not the linker, but thanks :)
--- Quote from: kkez on August 01, 2006, 10:45:36 pm ---I've had the same problem, and i solved it this way: enter the library full name (eg libsomething.a or something.lib) and then prepend it with these two chars: .\ so the resulting filename will be .\libsomething.a or .\something.lib.
--- End quote ---
That did it!!. Thanks a lot!
Navigation
[0] Message Index
[#] Next page
Go to full version