LD_LIBRARY_PATH is not working in Makefile

If LD_LIBRARY_PATH is exported in Makefile and makefile is not working as you have expected, then you should try updating LIBRARY_PATH.

LIBRARY_PATH is used by gcc before compilation to search for directories containing libraries that need to be linked to your program.

If you wish to link static libraries, you should update LIBRARY_PATH and not LD_LIBRARY_PATH. I made a mistake and suffered for 2 hours.

LD_LIBRARY_PATH is used by your program to search for directories containing the libraries after it has been successfully compiled and linked.

See this question.

Advertisements

About Dilawar

Graduate Student at National Center for Biological Sciences, Bangalore.
This entry was posted in Linux, Programming and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s