Configure Script Issue
-
This was the most appropriate place that I saw to post a C build system question that I saw so, sorry if there is a better place that I missed. Anyhow, I have run into an issue running configure where the linker is not finding the library that I'm specifying. I'm down to guesses so, any direction would be helpful. The configure command that I've constructed is below but, basically, I'm using LDFLAGS to point to the .so file that resides in a non-standard location. I'm using CFLAGS to point to the includes directory where the header files reside and LIBS to indicate the library that I'm using. There is another directory /usr/local/bin that contains three binaries that I don't know how to specify with the configure command. I'm trying to build GNU TLS from source after installing Nettle from the source files as well. Thank you in advance!
./configure CFLAGS="-I/usr/local/include/nettle/" LDFLAGS="-L/usr/local/lib64" LIBS="-lnettle"
-
This was the most appropriate place that I saw to post a C build system question that I saw so, sorry if there is a better place that I missed. Anyhow, I have run into an issue running configure where the linker is not finding the library that I'm specifying. I'm down to guesses so, any direction would be helpful. The configure command that I've constructed is below but, basically, I'm using LDFLAGS to point to the .so file that resides in a non-standard location. I'm using CFLAGS to point to the includes directory where the header files reside and LIBS to indicate the library that I'm using. There is another directory /usr/local/bin that contains three binaries that I don't know how to specify with the configure command. I'm trying to build GNU TLS from source after installing Nettle from the source files as well. Thank you in advance!
./configure CFLAGS="-I/usr/local/include/nettle/" LDFLAGS="-L/usr/local/lib64" LIBS="-lnettle"
-
This was the most appropriate place that I saw to post a C build system question that I saw so, sorry if there is a better place that I missed. Anyhow, I have run into an issue running configure where the linker is not finding the library that I'm specifying. I'm down to guesses so, any direction would be helpful. The configure command that I've constructed is below but, basically, I'm using LDFLAGS to point to the .so file that resides in a non-standard location. I'm using CFLAGS to point to the includes directory where the header files reside and LIBS to indicate the library that I'm using. There is another directory /usr/local/bin that contains three binaries that I don't know how to specify with the configure command. I'm trying to build GNU TLS from source after installing Nettle from the source files as well. Thank you in advance!
./configure CFLAGS="-I/usr/local/include/nettle/" LDFLAGS="-L/usr/local/lib64" LIBS="-lnettle"
You don't say whether make completes successfully or not. The compiler flags given tell the compiler where to find the pieces to buld the program. If the compile has completed successfully, but when you try to run the program you get a message
"error while loading shared libraries: <libname.so>: cannot open shared object file: No such file or directory
then the problem is at runtime, not compile time. As
Randor
notes, you can tell the link-loader where to find the library with LD_LIBRARY_PATHk5054@localhost$ LD_LIBRARY_PATH=/usr/local/lib64 myprog arg1 arg2
sets LD_LIBRARY_PATH for the given command. To set for a single session do
k5054@localhost$ export LD_LIBRARY_PATH=/usr/local/lib64
k5054@localhost$ myprog arg1 arg2You can add that to your shell's .profile file. and it will be set every time you log in. If you want to set this up permanently for all users ont the system, then as root create a file /etc/ld.so.conf.d/local.conf containing the single line
/usr/local/lib64
Now, as root, run
ldconfig
, and you should be able to run your program from any login, without needing to set LD_LIBRARY_PATH in your .profile or per session/per command. you can check what libraries are being loaded using the ldd command<
k5054@localhost$ ldd /bin/bash
linux-vdso.so.1 (0x00007ffebf5f6000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f7ec6539000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7ec6533000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7ec6341000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7ec66b5000)If the link-loader can't find a library, it will show
libsomelib.so => not found
Keep Calm and Carry On