Like Tree2Likes
  • 1 Post By Salem
  • 1 Post By tabstop

Need some help linking to libraries (using ./configure and stuff).

This is a discussion on Need some help linking to libraries (using ./configure and stuff). within the Tech Board forums, part of the Community Boards category; Basically, I was able to build and install this required library, and using libtool, I was able to put the ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    245

    Need some help linking to libraries (using ./configure and stuff).

    Basically, I was able to build and install this required library, and using libtool, I was able to put the library here:

    /net/hu19/jxd1581/lib/libnssi_env.la

    Now, I have this other project, that contains Makefile.am, Makefile.in configure.ac, configure, etc etc.

    I do
    ./configure --prefix=$HOME, where $HOME is /net/hu19/jxd1581

    However, when I run make, I get this

    Code:
    make[3]: Entering directory `/net/hu19/jxd1581/mware/fms/trunk/cod'
    /bin/sh ./libtool --tag=CC   --mode=link gcc  -g -O2  -L/net/hu19/jxd1581/lib -o libcod.la -rpath /net/hu19/jxd1581/lib cod.lo cod_node.lo cg.lo standard.lo -ldild   -lm  -lnssi_env -latl ./../fm/libfm.la
    grep: /usr/local/lib/libnssi_env.la: No such file or directory
    /bin/sed: can't read /usr/local/lib/libnssi_env.la: No such file or directory
    libtool: link: `/usr/local/lib/libnssi_env.la' is not a valid libtool archive
    Why is it looking for libnssi_env.la (-lnssi_env) in /usr/local/lib??

    How do I change the appropriate ./configure, configure.ac etc files to look for the library in /net/hu19/jxd1581/lib

    Do I change the path variable?

    Thanks a lot!
    Last edited by dayalsoap; 06-04-2011 at 12:41 AM.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    245
    I tried appending LD_LIBRARY_PATH to include the directory, but no such luck so far...

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    245
    Even BEFORE make errors, ./configure prints this:

    checking needed link args for nssi_env package... /net/hu19/jxd1581/lib

    So, during the configure, it seems to know where it is. Why is make STILL looking for it in /usr/local/lib?????

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    Who wrote your .configure (or where did you download it from)?

    It's just a text file, perhaps open it in the editor and look for /usr/local ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    May 2010
    Posts
    245
    It's part of an in-house repository. I looked for /usr/local/lib and there are a LOT of entries. I guess I could append my directory to those.

    There has to be an easier way, though...

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    245
    There has to be some flag? this configure script is all part of autotools...

  7. #7
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,676
    The normal format for an archive name is lib<library name>.a, and you specify it as a linker parameter with -l<library name>. So what's up with libnssi_env.la? Should it just be libnssi_env.a? That's what is suggested by your linker parameter -lnssi_env (notice the lack of a .l).

  8. #8
    Registered User
    Join Date
    May 2010
    Posts
    245
    Quote Originally Posted by anduril462 View Post
    The normal format for an archive name is lib<library name>.a, and you specify it as a linker parameter with -l<library name>. So what's up with libnssi_env.la? Should it just be libnssi_env.a? That's what is suggested by your linker parameter -lnssi_env (notice the lack of a .l).
    That's something that libtool creates.

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    245
    Maybe I'm asking the wrong question?

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    > It's part of an in-house repository.
    Or you're asking in the wrong place.

    Seriously, if you've got something which is proprietary, hidden from us, and has generally been mucked about with by person(s) unknown, there isn't a lot we can say.

    The first thing to answer is what changed between when it worked last, and the appearance of the error message(s).

    Perhaps next, learn enough bash to be able to get the general idea of what is going on inside the configure script.
    BASH with Debugger and Improved Debug Support and Error Handling may be helpful in running it in a controlled manner; perhaps some earlier command is producing bad output which is mis-interpreted later on.
    rags_to_riches likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  11. #11
    Registered User
    Join Date
    May 2010
    Posts
    245
    Quote Originally Posted by Salem View Post
    > It's part of an in-house repository.
    Or you're asking in the wrong place.

    Seriously, if you've got something which is proprietary, hidden from us, and has generally been mucked about with by person(s) unknown, there isn't a lot we can say.

    The first thing to answer is what changed between when it worked last, and the appearance of the error message(s).

    Perhaps next, learn enough bash to be able to get the general idea of what is going on inside the configure script.
    BASH with Debugger and Improved Debug Support and Error Handling may be helpful in running it in a controlled manner; perhaps some earlier command is producing bad output which is mis-interpreted later on.
    I mean, it's clear from your first response, that you're not familiar with standard tools like autoconfig and libtool. These are standard tools, that's why I'm asking the community.

  12. #12
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    Why don't you ask...I don't know...your co-workers???

  13. #13
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,822
    Until today, I'd never heard of a library being called .la, so I just rather assumed that someone had done some serious mucking about with it.

    Also, have you figured out yet the delta between when it last worked and the current state?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  14. #14
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by dayalsoap View Post
    I mean, it's clear from your first response, that you're not familiar with standard tools like autoconfig and libtool. These are standard tools, that's why I'm asking the community.
    If there was a problem with autotools, that would be one thing. (It still wouldn't belong on this forum, but on the GNU bug reporting list.) But your in-house configure script is just that, your in-house configure script. That's where the error is, so that's where you're going to have to look for it. And I'm pretty sure no one else here works at the same place you do, so no one else has a copy of your in-house configure script.
    stahta01 likes this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linking to libraries
    By davbeck in forum C Programming
    Replies: 3
    Last Post: 09-27-2008, 05:56 PM
  2. Help with linking to other c++ libraries via .net
    By pipercubusa in forum C++ Programming
    Replies: 0
    Last Post: 05-02-2005, 02:08 PM
  3. Linking and Libraries
    By krygen in forum C++ Programming
    Replies: 14
    Last Post: 12-26-2004, 03:01 PM
  4. Dynamically linking libraries
    By neandrake in forum Windows Programming
    Replies: 5
    Last Post: 06-18-2003, 03:54 PM
  5. Linking .h files to libraries
    By sean in forum C++ Programming
    Replies: 2
    Last Post: 10-27-2001, 09:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21