Reputation: 673
I downloaded iconv yesterday, and installed it using:
$ ./configure --prefix=/usr/local
$ make
$ make install
When I tried to run iconv
from the shell, I got a complaint that the shared object file is not found, so I executed export LD_LIBRARY_PATH=/usr/local/lib
. Then iconv worked.
This caused an error in my application. I was unaware that one of the source files already included iconv.h
. Today I successfully built the debug version multiple times in eclipse, but when it comes to the release build, I get these errors:
undefined reference to `libiconv_close'
undefined reference to `libiconv_open'
undefined reference to `libiconv'
I then panicked, and ran make uninstall
, restarted, but the problem remains. How can I get my program working again?
ldconfig -v | grep "iconv" shows:
libiconv.so.2 -> libiconv.so.2.5.1
I'm on Ubuntu 12.04 LTS
Upvotes: 0
Views: 579
Reputation: 70263
LD_LIBRARY_PATH
is an override that should be used only for debugging purpose, or to work around bugs that would be too hard to fix otherwise.
In no case should you set it globally in your environment, because exactly what you described here is bound to happen sooner or later, especially when you're installing manually compiled software to system directories... (Question: Why didn't you install iconv
via your package manager? That should always be your first choice.)
If your iconv
installation requires a library path, create an alias with a local override:
alias iconv="LD_LIBRARY_PATH=/usr/local/lib iconv"
This makes iconv
run correctly, but does not influence other packages, or build processes.
Bottom line, find the export LD_LIBRARY_PATH=...
(wherever you might have put it), and get rid of it. That should make your application compile correctly again (unless, of course, you have borked your system by manual installs / uninstalls to /usr
...)
Upvotes: 1