cannot find library in makefile

This is a discussion on cannot find library in makefile within the C Programming forums, part of the General Programming Boards category; Hello, I keep getting the following error message when I try and include the libraries. The path to the libraries ...

  1. #1
    UK2
    Join Date
    Sep 2003
    Posts
    112

    cannot find library in makefile

    Hello,

    I keep getting the following error message when I try and include the libraries.
    The path to the libraries is correct I have double checked.

    Can anyone tell me if I am missing something there.

    many thanks,

    Code:
    make: Circular tb_eng.o <- tb_eng.o dependency dropped.
    make: Circular resources.o <- resources.o dependency dropped.
    gcc -Wall -ggdb -O0 -D_DEBUG tb_eng.o resources.o -o engine -L/opt/tb/lib/release/i568-linux -ltbstreamserver -lbtxstream -ltbxmedia -ltbxappsutil -ltbxhost
    /usr/bin/ld: cannot find -ltbstreamserver
    collect2: ld returned 1 exit status
    make: *** [engine] Error 1
    Code:
    OBJECT_FILES = tb_eng.o resources.o
    CFLAGS = -Wall -ggdb -O0 -D_DEBUG
    CC = gcc
    LIBS_PATH = -L/opt/tb/lib/release/i568-linux                                           
    INC_PATH = -I/opt/tb/inc  -I/opt/tb/inc/i586-linux                                     
                                                                                           
    LIBS = -ltbstreamserver -lbtxstream -ltbxmedia -ltbxappsutil -ltbxhost                
                                                                                           
        engine: $(OBJECT_FILES)                                                            
        $(CC) $(CFLAGS) $(OBJECT_FILES) -o engine $(LIBS_PATH) $(LIBS)                     
                                                                                           
        tb_eng.o: tb_eng.o                                                                 
        $(CC) -c  $(CFLAGS) $(INC_PATH) tb_eng.c                                           
                                                                                           
        resources.o: resources.o                                                           
        $(CC) -c $(CFLAGS) $(INC_PATH) resources.c                                         
                                                                                           
        clean:                                                                             
            rm -f *.o engine

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    And you definitely have a libtbstreamserver (.a or .so) somewhere in your system?

    --
    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
    UK2
    Join Date
    Sep 2003
    Posts
    112
    Yes have double checked this.

    The library is called:
    libtbstreamserver.a
    libtbstreamserver.so.2.1

    This is the path:
    /opt/tb/lib/release/i586-linux

    Thanks

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    if you do "file libtbstreamserver" (add suitable path if needed), what does it output. And what does gcc -v output?

    --
    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.

  5. #5
    UK2
    Join Date
    Sep 2003
    Posts
    112
    Sorry,

    But I am not exactly sure what you want me to do? I am not sure I fully understand.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    "file" is a command that shows you what the type of contents of a file is. In this case, I expect it to say that it's a ELF, shared librar, x86-64 or i386. I also want to know what architecture your gcc is building for, so posting the output of gcc -v will give me that info.

    --
    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.

  7. #7
    UK2
    Join Date
    Sep 2003
    Posts
    112
    Hello,

    Details below.

    I have also discovered that if I delete -ltbstreamserver. It will error and say it can't find -lbtxstream. Which is the next one along.

    Code:
    [steve@localhost i586-linux]$ file libtbstreamserver.a
    libtbstreamserver.a: current ar archive
    [steve@localhost i586-linux]$ file libtbstreamserver.so.2.1
    libtbstreamserver.so.2.1: symbolic link to `libtbstreamserver.so.2.1.11'
    Code:
    Using built-in specs.
    Target: i386-redhat-linux
    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
    Thread model: posix
    gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)
    Thanks,

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Ok, so we need the output of "file libtbstreamserver.so.2.1.11" now. Sorry, I should have thought of that.

    --
    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.

  9. #9
    UK2
    Join Date
    Sep 2003
    Posts
    112
    Hello,

    Thanks for your effort.
    The problem was this: LIBS_PATH = -L/opt/tb/lib/release/i568-linux

    It should be 586-linux.

    I will always remember to check typos first.

    Thanks,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 10:50 PM
  2. very weird .h problem
    By royuco77 in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2005, 07:55 AM
  3. about Makefile and Macro
    By tom_mk in forum C++ Programming
    Replies: 1
    Last Post: 09-18-2003, 01:07 PM
  4. Borland 5.5 Makefile woes...
    By gprogga in forum C++ Programming
    Replies: 3
    Last Post: 06-01-2003, 02:20 AM
  5. Won't Return pointer, i can't find why...
    By ss3x in forum C++ Programming
    Replies: 2
    Last Post: 02-28-2002, 07:50 PM

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