How can I compile GCC with a shared library?


I create shared library

I use this command to create connections:

ln -s
ln -s

And now I try to compile my program using:

gcc main.c -o main -L. -libpl

but I have errors:

/usr/bin/ld: cannot find -libpl
collect2: error: ld returned 1 exit status

What should I do to fix it? How can I compile it?


The line


works correctly.

Compile with:

gcc main.c -o main -L. -lpl

Run with:


Answered By – Ice

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published