Linux cc compiling a library in a directory inside a project?

My directory structure looks like this:

-xmllib
    -libxml++-1.0.a
-main.cc

      

.. and I issue the command:

cc -lstdc++ -L./xmllib -llibxml++-1.0.a main.cc

      

But then he tells me that he cannot find the binary for the library ... although I issued the command from the root directory.

/usr/bin/ld: cannot find -llibxml++-1.0.a main.cc
collect2: ld returned 1 exit status

      

Is there any reason cc can't find the binary library?

I am using cc version 2.96 (yes it is old).

+2


source to share


1 answer


Change this:

-llibxml++-1.0.a

      

:



-lxml++-1.0

      

In Posix, the linker option -l

does not need a prefix lib

or extension .a

.

+6


source







All Articles