Author Topic: getting relative paths to work?  (Read 3122 times)

Offline Curmudgeon

  • Single posting newcomer
  • *
  • Posts: 6
getting relative paths to work?
« 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: getting relative paths to work?
« Reply #1 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.

« Last Edit: June 09, 2009, 06:51:57 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Curmudgeon

  • Single posting newcomer
  • *
  • Posts: 6
Re: getting relative paths to work?
« Reply #2 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.