Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Curmudgeon on June 09, 2009, 04:22:54 pm

Title: getting relative paths to work?
Post by: Curmudgeon on June 09, 2009, 04:22:54 pm

What does c::b determine what to use as the base for relative paths?

I have a perfectly working project which I'd like to convert to relative paths so it can be moved without breaking.
I navigate to the library file and when it asks if I want to use relative paths I answered 'yes'.
It can no longer find the library.

Code
Linking console executable: Debug\gtest_maind.exe
mingw32-g++.exe: gtest-1.3.0\msvc\Debug\libgtestd.a: No such file or directory

Should this just work without me having to ask? Is this a bug?
Title: Re: getting relative paths to work?
Post by: stahta01 on June 09, 2009, 06:41:29 pm
Most paths are relative to the project.cbp location; I am not certain if they all are relative to the project.
Tim S

Edit: Are you specifying the Library name in one spot and the Library search folder in another?
If not, please do it that way; it is the normal way it is done.

Project -> Build Options
Select Target in left hand pane
Tab: Linker Settings
Link Libraries pane is where you add the library name to be used.

Project -> Build Options
Select Target in left hand pane
Tab: Search Directories
Linker pane is where you add the path to libraries.

Title: Re: getting relative paths to work?
Post by: Curmudgeon on June 09, 2009, 07:47:39 pm
It seems to be when you specify a relative path to the library but no library search path.
I put in a library as a file name only and a search path and that corrects it.
It really should work either way though.
Thanks for the help.