Where to define LD_LIBRARY_PATH and PKG_CONFIG_PATH variables?
- I just installed twinkle the other day and it is running on my ss7 Asterisk box. It works great but I had to export LD_LIBRARY_PATH=/usr/local/lib/ and export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ while doing the ./configure in order to get everything to work.
I have noticed that when I run twinkle the first time after installing, it runs great. Then, when I go to use twinkle later, it has an issue trying to find a library that I can't recall off the top of my head. If I recompile, export the two paths above, and then reinstall all is well.
I did not run ldconfig after installing commoncpp2. Is this the cause of needing to do the export so the installer can find the library paths? Is there a place where these variables can be defined/hardcoded so that this issues does not arise again?
- This is a general reply, because I haven't run into the problem (at least currently, I'm using the Debian package).2012/3/13 Chris <ctwombly@...>
I did not run ldconfig after installing commoncpp2. Is this the cause of needing to do the export so the installer can find the library paths?It's not the installer that cares aboutbut the dynamic linker. The dynamic linker might be run after some compilation steps (during "make"), but definitely it is run every time you're starting the program. It probably works for you immediately after installation just because you're starting twinkle from the same shell where you defined the environment variables.So the solution is to either make the libraries be found globally without needing LD_LIBRARY_PATH, by running ldconfig and perhaps first fixing /etc/ld.so.conf, or to always set the environment variable(s) in the process that is starting twinkle. You could do the latter by creating a wrapper script (save as "twinklewrapper", run "chmod +x twinklewrapper"),#!/bin/shexport LD_LIBRARY_PATH=/usr/local/lib/export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ # probably not needed/your/path/to/twinkleChristian.