NewtSoup
Posts: 14
Joined: Thu Jan 21, 2016 4:04 pm
Location: Leicester UK

Library Missing?

Thu Jan 28, 2016 1:37 pm

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·

User avatar
Paeryn
Posts: 2146
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Library Missing?

Thu Jan 28, 2016 3:46 pm

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.
She who travels light — forgot something.

samxaverian
Posts: 1
Joined: Fri Dec 29, 2017 8:45 pm

Re: Library Missing?

Fri Dec 29, 2017 8:50 pm

I have the same problem.
Can you please mention where to include those lines?

User avatar
Paeryn
Posts: 2146
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Library Missing?

Tue Jan 02, 2018 12:15 am

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
She who travels light — forgot something.

Return to “OpenGLES”

Who is online

Users browsing this forum: No registered users and 4 guests