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
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
Copyright © 2021 Jogjafile Inc.
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-lXlstThe 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:
.sofile). The link is not linked to the correct .so file.Solutions:
/usr/liband 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/libln -s libXtst.so.6 libXtst.soFor 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
/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-devapt-cache search libltdl-devapt-cache search libXtst-devInstall the missing lib.
please refer below link. this might help.
http://wei48221.blogspot.com/2017/08/linux-how-to-solve-problem-of-usrbinld.html