LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2009, 01:11 AM   #1
mk86
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Problem due to linking of an external compiled file to my code


Hi,

I have a problem due to the dynamically linking of the external compiled file.

Currently I'm trying to write API's for postgreSQL.
For which I would require the libpq.so to be dynamically linked before execution.

The problem is I'm unable to find the actual place that would take care of linking it before my file is getting called.

I tried setting LD_PRELOAD env variable with the corresponding libpq.so
This is not working.

I'm not able to find the actual flow on how the libraries are used/loaded because I'm using an external hardware (Linux based).

Is there any way to track how and when the libraries are loaded and how to make sure that this postgreSQL library is linked properly.

Please help me out in solving this.

Thanks in advance
 
Old 04-28-2009, 06:10 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi,

Welcome to LQ!

To be "dynamically linked" at run-time the library (same version) needs
to be around at compile time; then it should be sought in /etc/ld.so.cache
and the LD_LIBRARY path.

Have a read of man ldd, man ldconfig, man ld.so ...


Cheers,
Tink
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in using both load time linking and runtime linking durgaprasad_j Linux - General 0 08-01-2006 04:49 AM
Make Trouble linking some fortran code Make file problem? any ideas? TheBrick Linux - General 0 05-17-2006 12:21 PM
Linker is linking to the latest compiled changes manikan Programming 2 03-02-2006 11:41 AM
problem in linking css file in xml geethu Programming 0 09-10-2005 06:51 AM
Problem executing. This is not a due to code error :( estranged Linux - Software 2 09-06-2003 12:20 PM


All times are GMT -5. The time now is 05:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration