Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to set run configuration of CDT project for running the application in command?(problem of linking to share library in command prompt)
How to set run configuration of CDT project for running the application in command? [message #552274] Wed, 11 August 2010 14:45 Go to next message
freshtree  is currently offline freshtree Friend
Messages: 5
Registered: August 2010
Junior Member
Hi all,

I am developing an application using eclipse CDT.
All the way I am using eclipse to test my application which is consisted of an executable project depends on other shared projects. I have no problem of running the application in eclipse as I set the LD_LIBRARY_PATH in run configuration of the executable project with the shared library of other projects.

Example:
ExecutableProject depends on ProjectB, I set the run configuration of ExecutableProject point to the debug folder of ProjectB:
LD_LIBRARY_PATH
${workspace_loc:/ProjectB/Debug}


This works while running the application in eclipse,
but it can not run when i try to execute the application in command prompt, it shows that it can't find the share library of ProjectB,
"error while loading shared libraries: cannot open shared object file: No such file or directory"

Do I need to write any configuration file on my own in order to run the application in command?
Re: How to set run configuration of CDT project for running the application in command? [message #552404 is a reply to message #552274] Thu, 12 August 2010 06:30 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
You have to set the LD_LIBRARY_PATH on the command prompt as well.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: How to set run configuration of CDT project for running the application in command? [message #552540 is a reply to message #552404] Thu, 12 August 2010 15:02 Go to previous messageGo to next message
freshtree  is currently offline freshtree Friend
Messages: 5
Registered: August 2010
Junior Member
I would need to deliver the application to third party, does it means i need to make sure the user set the LD_LIBRARY_PATH before running the application? Any easier way?

Sorry, I am not familiar with all these.
Re: How to set run configuration of CDT project for running the application in command? [message #552545 is a reply to message #552540] Thu, 12 August 2010 15:07 Go to previous messageGo to next message
Austin Morgan is currently offline Austin MorganFriend
Messages: 42
Registered: July 2009
Member
The library your application requires should be installed into the
standard library locations for your distribution. Therefore it is not
necessary to set the LD_LIBRARY_PATH because your library will already
be in the path. Overriding LD_LIBRARY_PATH is only for testing
applications that require libraries that are still in development.
Re: How to set run configuration of CDT project for running the application in command? [message #552903 is a reply to message #552545] Sat, 14 August 2010 10:00 Go to previous messageGo to next message
freshtree  is currently offline freshtree Friend
Messages: 5
Registered: August 2010
Junior Member
I am not so clear about the distribution step.
Can you explain about how to install the library to standard library for distriburtion?

[Updated on: Sat, 14 August 2010 14:26]

Report message to a moderator

Re: How to set run configuration of CDT project for running the application in command? [message #552932 is a reply to message #552274] Sat, 14 August 2010 16:57 Go to previous messageGo to next message
freshtree  is currently offline freshtree Friend
Messages: 5
Registered: August 2010
Junior Member
I dont have the permission to install the shared library in the standard library, any setting in eclipse that enable me to compile the binary so that it can find the shared library in somewhere that i store the library?

[Updated on: Sat, 14 August 2010 16:58]

Report message to a moderator

Re: How to set run configuration of CDT project for running the application in command? [message #552960 is a reply to message #552274] Sun, 15 August 2010 07:38 Go to previous message
freshtree  is currently offline freshtree Friend
Messages: 5
Registered: August 2010
Junior Member
Finally I found out the way to encode the rpath for the library in the linker so that the binary contain the supplemental path for the shared library. This solve my problem!

http://www.eyrie.org/~eagle/notes/rpath.html

BTW, thanks for all the helps~
Previous Topic:subclipse verse subversive?
Next Topic:Missing formatter
Goto Forum:
  


Current Time: Tue Jul 05 17:02:58 GMT 2022

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

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

Back to the top