probably an old question about overriding hardcoded library search paths

Jonathan Wakely jwakely.gcc@gmail.com
Sun Nov 11 21:02:00 GMT 2012


On 11 November 2012 20:41, Charles Smith <cts.private@yahoo.com> wrote:
> God, you guys are fast!
>
> Okay, I tried that, and then it came up with - first, the pthread library was missing, and then when I added -lpthread (maybe the dynamic version had brought that in?) - these were missing:
> /home/me/opt/lib/libsqlite3.a(sqlite3.o): In function `unixDlError':
> /home/me/opt/sqlite-3.6.19/sqlite3.c:25735: undefined reference to `dlerror'
> /home/me/opt/lib/libsqlite3.a(sqlite3.o): In function `unixDlSym':
> /home/me/opt/sqlite-3.6.19/sqlite3.c:25762: undefined reference to `dlsym'
> /home/me/opt/lib/libsqlite3.a(sqlite3.o): In function `unixDlClose':
> /home/me/opt/sqlite-3.6.19/sqlite3.c:25766: undefined reference to `dlclose'
> /home/me/opt/lib/libsqlite3.a(sqlite3.o): In function `unixDlOpen':
> /home/me/opt/sqlite-3.6.19/sqlite3.c:25721: undefined reference to `dlopen'
>
> I added -ldl and it then linked.
>
> Funny.  I guess the dynamic version of sqlite provides those, but my other shared libraries don't?

The dynamic version probably doesn't provide them, but has a
dependency on libpthread and libdl that causes the runtime linker to
link to it at runtime.  Run ldd on libsqllite3.so and you'll probably
see it depends on libpthread.so and libdl.so, run readelf -d
libsqlite3.so and you'll see the libs it needs.



More information about the Gcc-help mailing list