Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home »  » C / C++ IDE (CDT) » How to link dynamic/shared libraries in eclipse?
How to link dynamic/shared libraries in eclipse? [message #1776496] Fri, 17 November 2017 04:07 Go to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 6
Registered: November 2017
Junior Member
I am using eclipse in ubuntu and i want to link .so files to my projects.

How to link dynamic libraries to my project??
Re: How to link dynamic/shared libraries in eclipse? [message #1776570 is a reply to message #1776496] Fri, 17 November 2017 19:30 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 399
Registered: June 2014
Senior Member
You need to add the library to the search path:

project properties->C/C++ build->Settings->GCC C++ Linker->Libraries->[-L option] section


Re: How to link dynamic/shared libraries in eclipse? [message #1776657 is a reply to message #1776570] Mon, 20 November 2017 05:44 Go to previous messageGo to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 6
Registered: November 2017
Junior Member
I have done it still am getting many linking errors and am getting a error message as 'recipe for target failed'.

Should i add .so files in project properties->C/C++ build->Settings->GCC C++ linker->SharedLibrary settings ??
Re: How to link dynamic/shared libraries in eclipse? [message #1776668 is a reply to message #1776657] Mon, 20 November 2017 08:12 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 399
Registered: June 2014
Senior Member
Please post actual command line and error messages from Build console.
Re: How to link dynamic/shared libraries in eclipse? [message #1776773 is a reply to message #1776668] Tue, 21 November 2017 12:57 Go to previous messageGo to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 6
Registered: November 2017
Junior Member
Actually i was using openssl for my project and now i want to migrate from openssl to nanossl. So am changing the libraries from openssl to nanossl.

I had given my shared libraries path in properties->C/C++ build->Settings->GCC C++ linker->SharedLibrary settings.

But when i build my project in eclipse, it says the some of functions are undefined. And for undefined functions it is still taking reference from inbuilt openssl libraries of linux environment.
Re: How to link dynamic/shared libraries in eclipse? [message #1776775 is a reply to message #1776773] Tue, 21 November 2017 14:11 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 399
Registered: June 2014
Senior Member
Sounds like neat project.

If you can post your output from the build console we can more likely help.
Re: How to link dynamic/shared libraries in eclipse? [message #1776869 is a reply to message #1776775] Wed, 22 November 2017 11:51 Go to previous messageGo to next message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 6
Registered: November 2017
Junior Member
index.php/fa/31358/0/

index.php/fa/31357/0/

I have linked my library and when i run from command line then it gives segmentation fault. When i run 'ldd' command to see dependencies, it says that path of that library is not found and i have attached that photo here.

[Updated on: Wed, 22 November 2017 11:56]

Report message to a moderator

Re: How to link dynamic/shared libraries in eclipse? [message #1776930 is a reply to message #1776869] Wed, 22 November 2017 21:00 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 399
Registered: June 2014
Senior Member
You need to set LD_LIBRARY_PATH to the location of the so at runtime. Full details here: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
Re: How to link dynamic/shared libraries in eclipse? [message #1777213 is a reply to message #1776930] Mon, 27 November 2017 07:59 Go to previous message
Siddalinga Swamy is currently offline Siddalinga SwamyFriend
Messages: 6
Registered: November 2017
Junior Member
Thank you for sharing the link but they have explained about linking shared libraries through command line, but i need to specify my shared libraries in eclipse IDE
Previous Topic:Eclipse Permission Denied
Next Topic:When .project is changed, how do I update the makefile on CLI ?
Goto Forum:
  


Current Time: Sun Dec 17 00:31:47 GMT 2017

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

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