Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Linking 3rd Party libraries issue(Attempting to link 3rd part libraries is adding extra directory separated by a colon (:))
Linking 3rd Party libraries issue [message #1791244] Tue, 26 June 2018 15:36 Go to next message
Tim Anderson is currently offline Tim AndersonFriend
Messages: 3
Registered: June 2018
Junior Member
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 #1791503 is a reply to message #1791244] Sun, 01 July 2018 09:26 Go to previous messageGo to next message
David VavraFriend
Messages: 805
Registered: October 2012
Senior Member
Adding library paths only has an effect when Eclipse is generating the makefile (Managed Builds).
With a Makefile project, you are responsible for the makefile content.
You need to edit your makefile.
Re: Linking 3rd Party libraries issue [message #1791575 is a reply to message #1791503] Mon, 02 July 2018 15:07 Go to previous messageGo to next message
Tim Anderson is currently offline Tim AndersonFriend
Messages: 3
Registered: June 2018
Junior Member
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 Go to previous message
David VavraFriend
Messages: 805
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.




Previous Topic:Eclipse Marketplace.No Go
Next Topic:Eclipse error?
Goto Forum:
  


Current Time: Fri Nov 16 10:32:38 GMT 2018

Powered by FUDForum. Page generated in 0.02703 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top