Page 1 of 1

Library Missing?

Posted: Thu Jan 28, 2016 1:37 pm
by NewtSoup
Hello,

Hope this is the best place to put this -

When Compiling a test program I get the following error:

Code: Select all

/usr/bin/ld: cannot find -lGLESv2
collect2: error: ld returned 1 exit status
I've looked in /usr/lib and the only GL related library I can see is libgltf.so...

Bearing in mind that I'm really quite new to linux and open GL can someone explain how to make this go away?

( I'm used to programming in Java and Windows )

Thanks in advanceĀ·

Re: Library Missing?

Posted: Thu Jan 28, 2016 3:46 pm
by Paeryn
On the RPi the includes are in /opt/vc/include and the libraries are in /opt/vc/lib so you'll need to pass

Code: Select all

-I/opt/vc/include
when compiling and

Code: Select all

-L/opt/vc/lib
when linking.

Re: Library Missing?

Posted: Fri Dec 29, 2017 8:50 pm
by samxaverian
I have the same problem.
Can you please mention where to include those lines?

Re: Library Missing?

Posted: Tue Jan 02, 2018 12:15 am
by Paeryn
They need to be passed to the compiler, e.g. on the command line, in the Makefile or in your IDE of choice's settings. Note that the library names for the default firmware drivers have changed in Stretch (they did in Jessie but the old names were still used as well), they are now libbrcmGLESv2 and libbrcmEGL to differentiate them from the MESA versions.

Not complete examples, but to show you which is used for which... Typically other paths and libraries will be needed (like for libbcm_host etc.)

Code: Select all

gcc -I/opt/vc/include -c my_program.c -o my_program.o

Code: Select all

gcc -L/opt/vc/lib my_program.o -lbrcmGLESv2 -lbrcmEGL -o my_program