2
votes

Building Qt on Windows went find, but I'm having some issues on building it on Linux Mint 18. I downloaded qt-everywhere-opensource-src-5.7.0.tar.gz and extracted it to /home/user/Qt-Static/Qt5.7.0/. I then ran configure with the below command:

./configure -platform linux-g++-32 -prefix /home/user/Qt-Static/Qt5.7.0 -static -opensource -confirm-license -opengl desktop -make libs

Initially I got an error:

fatal error: bits/c++config.h: No such file or directory

Searching online I found the solution to this was to install gcc-multilib and g++-multilib. After this when I run configure I get the below output, which contains the error "The OpenGL functionality test failed!"

Creating qmake...
.........................................................................................Done.
Running configuration tests...
checking for C++11...  yes.
checking for C++14...  yes.
checking for C++1z...  yes.
checking for default C++ standard edition...  yes.
checking for 64-bit std::atomic...  yes.
checking for sse2...  yes.
checking for sse3...  yes.
checking for ssse3...  yes.
checking for sse4_1...  yes.
checking for sse4_2...  yes.
checking for avx...  yes.
checking for avx2...  yes.
checking for avx512f...  yes.
checking for avx512er...  yes.
checking for avx512cd...  yes.
checking for avx512pf...  yes.
checking for avx512dq...  yes.
checking for avx512bw...  yes.
checking for avx512vl...  yes.
checking for avx512ifma...  yes.
checking for avx512vbmi...  yes.
checking for ipc_sysv...  yes.
checking for zlib...  no.
checking for mtdev...  no.
checking for libjpeg...  no.
checking for libpng...  no.
checking for libdl...  yes.
checking for DB2...  no.
checking for InterBase...  no.
checking for MySQL (thread-safe)...  no.
checking for MySQL (thread-unsafe)...  no.
checking for OCI...  no.
checking for ODBC...  no.
checking for iODBC...  no.
checking for PostgreSQL...  no.
checking for SQLite2...  no.
checking for TDS...  no.
checking for NIS...  yes.
checking for Cups...  no.
checking for POSIX iconv...  yes.
checking for D-Bus...  no.
checking for libproxy...  no.
checking for Glib...  no.
checking for ICU...  no.
checking for PulseAudio...  no.
checking for OpenGL...  no.
The OpenGL functionality test failed!
 You might need to modify the include and library search paths by editing
 QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL in
 /home/user/Qt-Static/Qt5.7.0/qtbase/mkspecs/linux-g++-32.

After this no makefile is generated. Searching for this error I found a number of questions with the same problem, and various suggested solutions, but I couldn't find anything that worked.

I'm completely clueless when it comes to Linux. It appears that I have to set QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL, but I'm not actually sure what to set them to.

Could somebody help me out with this?

2
Have you installed all Opengl libraries for building? In general, you don't need to set the path by yourself, but you can do so in qmake.conf. To me this error looks that you have not installed all required opengl packages. - user3606329
I installed mesa-common-dev, libglu1-mesa-dev and libgl1-mesa-dev, but I think for all three it said, "0 to upgrade, 0 to newly install" so they all appear to come with Mint. Is there anything else I would need? - Assoluto

2 Answers

2
votes

I found that removing -opengl desktop from my configure parameters solves the problem.

On windows I needed to use the -opengl desktop or I got an OpenGL ES error messages. When I ran configure on Linux I used the same command and just changed the -platform and -prefix parameters, so -opengl desktop was still there. I'd forgotten it was there, but when I noticed I tried removing it and it worked, so Qt is compiling now. Thanks for the help.

1
votes

According to opengl-for-ubuntu14-building-qt-5-4, installing libgl1-mesa-dev will let you compile with -opengl desktop