Find the "name" of a library (-L -l switches)

Posted by sebastiangeiger on Stack Overflow See other posts from Stack Overflow or by sebastiangeiger
Published on 2010-05-26T08:38:42Z Indexed on 2010/05/26 8:41 UTC
Read the original article Hit count: 249

Being fairly new to C++ I have a question bascially concerning the g++ compiler and especially the inclusion of libraries. Consider the following makefile:

CPPFLAGS= -I libraries/boost_1_43_0-bin/include/ -I libraries/jpeg-8b-bin/include/
LDLIBS= libraries/jpeg-8b-bin/lib/libjpeg.a
# LDLIBS= -L libraries/jpeg-8b-bin/lib -llibjpeg

all: main

main: main.o
    c++ -o main main.o $(LDLIBS)

main.o: main.cpp
    c++ $(CPPFLAGS) -c main.cpp

clean:
    rm -rf *.o main

As you can see I declared the LDLIBS variable twice. My code is compiling and working if I use the makefile above. But if I deactivate the first LDLIBS entry and active the second one I get ld: library not found for -llibjpeg. I assume my libjpeg.a is just not called libjpeg but bears some different name.

Is there a way to find out the name of a given "libraryfile" libsomething.a or libsomething.dyn?

© Stack Overflow or respective owner

Related posts about c++

Related posts about library