Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Configure Script Issue

Configure Script Issue

Scheduled Pinned Locked Moved C / C++ / MFC
securitytoolshelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jblixt
    wrote on last edited by
    #1

    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"

    L K 2 Replies Last reply
    0
    • J jblixt

      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"

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, I think on Linux the LD_LIBRARY_PATH environment variable is used to find shared libs. You might be looking for ldconfig and /etc/ld.so.conf if you are on Linux.

      1 Reply Last reply
      0
      • J jblixt

        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"

        K Offline
        K Offline
        k5054
        wrote on last edited by
        #3

        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_PATH

        k5054@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 arg2

        You 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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups