Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to link our own libararies in eclipse?(Linking our own libraries)
How to link our own libararies in eclipse? [message #1786653] Wed, 09 May 2018 04:03 Go to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 11
Registered: November 2017
Junior Member
My project is linked to libssl and libcrypto libraries in default system path,

But i want to link my project to externally built libssl and libcrypto in my own path.

In properties->settings->GCC Linker-> if i type ssl and crypto, it takes from default path.

If i give my path in Library Search Path and select "Do not use default library" then i get error because some other functions need other default libarries.

So please tell me how to disable default search paths

[Updated on: Wed, 09 May 2018 04:08]

Report message to a moderator

Re: How to link our own libararies in eclipse? [message #1786657 is a reply to message #1786653] Wed, 09 May 2018 05:20 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Presumably you added ssl and crypto to the upper pane of
Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> GCC C++Linker --> Lbraries
marked Libraries (-l).

You can add paths in the lower pane marked Library search path (-L).
These will be searched before the builtin libraries.

Re: How to link our own libararies in eclipse? [message #1786662 is a reply to message #1786657] Wed, 09 May 2018 06:24 Go to previous messageGo to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 11
Registered: November 2017
Junior Member
yes i have added my libraries in Libraries(-l) and path in Library search path(-L)

But my project is taking libs from default path not from my path
Re: How to link our own libararies in eclipse? [message #1786675 is a reply to message #1786662] Wed, 09 May 2018 08:30 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
What makes you think so?
Are you certain the -L paths are correct?
Do they appear on the link command line in the log?

ftp://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html#SEC3
Quote:
...
-Lsearchdir
--library-path=searchdir

Add path searchdir to the list of paths that ld will search for archive libraries and ld control scripts. You may use this option any number of times. The directories are searched in the order in which they are specified on the command line. Directories specified on the command line are searched before the default directories.
...


If all else fails, you can also add the libraries as Other Objects in
Project --> Properties --> C/C++ Build --> Settings --> Tool Settings tab --> GCC C++Linker --> Miscellaneous
but I suspect you have the paths wrong.

[Updated on: Thu, 10 May 2018 01:59]

Report message to a moderator

Previous Topic:Cannot use Remote Debugging in Eclipse CDT Luna with Beaglebone black
Next Topic:How to force linker to keep section?
Goto Forum:
  


Current Time: Thu Apr 25 08:05:33 GMT 2024

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

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

Back to the top