Ld Cannot Find 'Glesv2' Library

I'm tring to cross-compiling qt 5.7.1 for raspberry pi 3 model B from a arch linux (64bits) host. So, in this purpose, I'm following this tutorial : . But, when i execute these commands in the "/opt/qt5pi/qt5build/" directory :

../qt-everywhere-opensource-src-5.7.1/configure -no-use-gold-linker -opengl es2 -device linux-rpi3-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtwebengine -skip qtscript -nomake examples -make libs

make

The linker tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/ld send this error :

ld: cannot find -lGLESv2

1 Answer

@allebas, I had your same problem and I hope this could be useful:

1) First on my .pro I had to link all necessary libraries, be careful because the order of the include is very very important, see below an example from an old project I have:

TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
        main.cpp

LIBS += -L "/usr/include/libdrm" \
        -lglfw -lrt -lm -ldl -lGLEW -lGLU -lGLESv2 -lGL \
        -lpthread -pthread -ldrm -lXdamage -lXfixes -xcb \
        -lxcb-glx -lxcb-dri2 -lXxf86vm -lXext -lX11 -lpthread -lxcb \
        -lXau -lXdmcp -lXcursor -lglut -lXrandr

2) if after double checking that this specific library is not installed on your system, then the following step should help you install the missing library(ies):

sudo apt-get install libglfw3-dev libgles2-mesa-dev

3) See also the following source as it explains how to do all installation steps if some library is still missing on your system

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest