Reputation: 68
I am getting a error when I try to compile some c++ code using the olcPixelGameEngine as a header file, the error is -
/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lpng
Upvotes: -1
Views: 907
Reputation: 425
Depending on the code being compiled, the error message may look like:
/usr/bin/ld
: cannot find -lc
/usr/bin/ld
: cannot find -lltdl
/usr/bin/ld
: cannot find -lXlst
The xxx represents the name of the library, for example, libc
.so, libltdl.so
, libXtst.so
. The naming rule is: lib + library name (i.e. xxx) + .so.
There are 3 possible reasons for such error to occur:
.so
file). The link is not linked to the correct .so file.Solutions:
/usr/lib
and correct any incorrect link.For example,
If the error message "/usr/bin/ld: cannot find -lXlst
" is caused by incorrect symbolic link, issue the commands below to correct it.
cd /usr/lib
ln -s libXtst.so.6 libXtst.so
For example,
If the error message "/usr/bin/ld: cannot find -lXlst" is caused by missing "libXtst.so" under "/usr/lib", issue the command below to install it.
apt-get install libxtst-dev
Additional note on how to install the missing lib.
Identify the missing lb
Error Message Missing lib
/usr/bin/ld: cannot find -lc ---------------------------------------------------->libc
/usr/bin/ld: cannot find -lltdl ---------------------------------------------------->libltdl
/usr/bin/ld: cannot find -lXlst ----------------------------------------------------> libXtst
Search for the missing lib
apt-cache search libc-dev
apt-cache search libltdl-dev
apt-cache search libXtst-dev
Install the missing lib.
please refer below link. this might help.
http://wei48221.blogspot.com/2017/08/linux-how-to-solve-problem-of-usrbinld.html
Upvotes: -1