could not read symbols: Archive has no index?

This is a discussion on could not read symbols: Archive has no index? within the C++ Programming forums, part of the General Programming Boards category; Hi, I've successfully build the OpenNL into libnl.a and put it to /usr/lib under Ubuntu 7.04 However, when I try ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    33

    could not read symbols: Archive has no index?

    Hi,

    I've successfully build the OpenNL into libnl.a and put it to /usr/lib under Ubuntu 7.04

    However, when I try to make a program that uses it, the linker output the following error:

    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libnl.a: could not read symbols: Archive has no index; run ranlib to add one
    collect2: ld returned 1 exit status

    So, what may be the problem? I've googling around but no help...

    Thanks in advance!

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Did you try to do "ranlin libnl.a" [save a copy of libnl.a first!]

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    s/ranlin/ranlib
    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.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    33
    I've tried ranlib libnl.a, but no output, no help... still the same error message when I try to compile the program using it.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What about doign "file libnl.a" - maybe you have the wrong version of the file for your architecture, or some such [I've downloaded the wrong version of a file once or twice, and also had bad links so that I got the wrong version even when I clicked the right links].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User
    Join Date
    Nov 2007
    Posts
    33
    libnl.a: current ar archive

    Is this correct?

  7. #7
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I had hoped that it would give some more info.

    Perhaps you cand download the source and build it yourself, see how that goes?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #8
    Registered User
    Join Date
    Nov 2007
    Posts
    33
    Actually this .a file is build by myself from the source

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Perhaps "ranlib -a" or "ranlib -s" will do what you want - I just looked up ranlib, and those make sense for the problem you see...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux Putting my children to sleep with futex!?
    By Abs in forum Linux Programming
    Replies: 18
    Last Post: 02-12-2009, 05:43 PM
  2. Reiventing the wheel (again)
    By Elysia in forum C++ Programming
    Replies: 5
    Last Post: 12-02-2007, 02:26 AM
  3. Function to check memory left from malloc and free?
    By Lechx in forum C Programming
    Replies: 4
    Last Post: 04-24-2006, 05:45 AM
  4. deleting a node by index
    By mouse163 in forum C++ Programming
    Replies: 4
    Last Post: 02-24-2005, 07:13 AM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 02:09 AM

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