Linking 3rd Party libraries issue [message #1791244] |
Tue, 26 June 2018 15:36 |
|
I have a project that I created from existing code using a Makefile. The project is made up of several different executable programs and uses configuration files which modify the actual compile and link lines for each of the programs.
Currently, one of my programs I need to link with some third party shared libraries so I've added the libraries to Project->Properties->C/C++ General->Paths and Symbols->Library Paths in the same order as they appear in the Makefile. Specifically:
- <root_dir>/3rdParty/osg/lib
- <root_dir>/lib
- <root_dir>/3rdParty/lib
When I build my project it fails because it can't find libraries in the <root_dir>/3rdParty/osg/lib directory. When I look at the link line in the Console I see the following:
-L<root_dir>/3rdParty/osg:<root_dir>/3rdParty/osg/lib -L<root_dir>/lib -L<root_dir>/3rdParty/lib
I'm not sure what's going on with the first entry where it added a directory that isn't in the list provided that is appended to the first directory separated by a colon (:).
I am running Eclipse 3.6.1 (Helios) with CDT 7.0.1.2010092413.
There are only 10 kinds of people in the world. Those that understand binary and those that don't.
|
|
|
|
Re: Linking 3rd Party libraries issue [message #1791575 is a reply to message #1791503] |
Mon, 02 July 2018 15:07 |
|
That's what I figured, but when I do a make outside of Eclipse, it runs fine and finds all the libraries.
The link line does not include the added directory that is appearing in Eclipse that is separated by a colon from the actual library path. I'm not sure where Eclipse is getting that other directory but it's not from the Makefile.
There are only 10 kinds of people in the world. Those that understand binary and those that don't.
[Updated on: Mon, 02 July 2018 16:46] Report message to a moderator
|
|
|
Re: Linking 3rd Party libraries issue [message #1791595 is a reply to message #1791575] |
Mon, 02 July 2018 16:53 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
All that Eclipse does is start the make as a process usually with a target 'all'.
You may have a different environment than one running in a command prompt window.
Other than that, Eclipse doesn't have any control over what make does.
You also should pay attention to <root_dir> if it is relative.
Make will likely not run in the same working directory under Eclipse as it would in a terminal window.
You might want to have a target which prints the working directory and environment.
In any case, the concatenated paths came from your makefile.
Is it perhaps -L$(some environment variable) ??
Something to consider.
Whatever the reason, you'll need to address it for running with CDT.
|
|
|
Powered by
FUDForum. Page generated in 0.03115 seconds