News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

getting relative paths to work?

Started by Curmudgeon, June 09, 2009, 04:22:54 PM

Previous topic - Next topic

Curmudgeon


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.

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?

stahta01

#1
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.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Curmudgeon

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.