Problems compiling Qt 5.8 on Debian 8.7.1
I have built and installed from source Qt version 5.8 on Debian 8.7.1.
While linking my program I get errors like this :
/usr/local/Qt-5.8.0/lib/libQt5MultimediaWidgets.so: undefined reference to `QGLContext::currentContext()@Qt_5' /usr/local/Qt-5.8.0/lib/libQt5MultimediaWidgets.so: undefined reference to `QGLShaderProgram::setAttributeArray(char const*, float const*, int, int)@Qt_5' /usr/local/Qt-5.8.0/lib/libQt5MultimediaWidgets.so: undefined reference to `QGLContext::getProcAddress(QString const&) const@Qt_5'
Am I missing some package or compile option ?
Can you show your .pro file ?
About my .pro file : It is very simple and there is nothing special about it. It has worked just fine on Windows and Kubuntu.
This is apparently a Debian problem when configuring Qt.
I found a reference to it in this post :
I made a mistake in 'configure' script. I didn't know that Debian had a separate package for QtGL extension, and 'configure' checks only if GL library is installed and if it is it assumes that QtGL is built-in into Qt (as in my RedHat ). You will have to configure without GL then.
It would take somebody more knowledgeable than me to fully understand the above.
So I have tried to compile Qt using
configure -no-opengl, but have now compilation errors in Qt itself like this:
error: undefined reference to 'vtable for QQuickFramebufferObject'
The manual describes this class as :
The QQuickFramebufferObject class is a convenience class for integrating OpenGL rendering using a framebuffer object (FBO) with Qt Quick.
What more do I need to do to to get a viable version of Qt on Debian ?
Did you install the OpenGL dev packages on your system ?
Yes, package libgl1-mesa-dev is installed.
I'm ready to give up Qt on Debian.
When calling configure again, did you do it from a clean state ?
In any case, what is the configure line you used to build Qt ?
hi, do you find way out ?
i also meet the same problem on cross compiling for my rpi3. my ENV is Qt5.7 + centos (x64).
@SGaist - A very clean slate : I deleted the folder and re-unpacked from the tar.gz file.
@JiujiuTong - No solution. I'm trying another Linux distribution before putting up a bug report.
What exact configure options did you give ?
my configure is :
"./configure -release -opengl es2 -skip webengine -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v "
my host is centos 7, the target is raspberry pi3, trying with cross compiler way,and should i take "-no-opengl" do you think?
@JiujiuTong wait a minute, there's a problem here, you are mixing a cross-compilation problem which is not related to the problem at hand for @Harry123 which is just trying to compile Qt for its desktop.
@Harry123 Can you share the configure line you used to compile Qt on your machine ?
I first tried
./configure -debugwhich gave me the problem of
I next tried
./configure -debug -no-openglwhich gave me the problem of
Can you check with
I'd recommend doing out of source builds. That way you can just nuke the build folder is something goes wrong.
It wouldn't work with
-opengl desktopbecause already when I used just
./configureI had a message about opengl missing.
I have anyway given up on compiling the sources -
configuresimply doesn't do the job correctly with the default flags, and each try takes hours.
I have taken to using instead the online installer, which installs a viable version optionally with the sources.
Would you know if I can use the online installer to install directly into the
/usrfolders such as
/usr/includeetc. ? Or after the installation to copy the installed folders to there?
In that case it means you don't have the OpenGL dev package installed.
You can't and you shouldn't even try. You'll be clearly messing with your distribution installation which is a very bad idea.
If you want to share your Qt installation with several users on your machine then use the default which is /opt otherwise, you can also simply install it in your home folder.
I'm the only user and the installation is on a VM.
I would like to reproduce the effect of Qt being installed from the repository, even though version 5.8 is not in it.
That's not a good idea. You are trying to replace your system Qt installation which has been built by the Debian folks in a state known to work for them.
Why do you want to replace it ?
If you want the Debian variant of Qt 5.8 then install the
experimentalversion of Debian.
OK, I gave up on this idea. Unfortunate that a repository does not exist for QT 5.8 (Debian experimental only contains parts).
I will stay with the online installation and will give up on my ambition to compile Qt.
Too bad, as I wanted a real debug version for easier debugging.
Like I already wrote, there seems to be something missing on your system.
You should be able to build Qt 5.8 without any problem on Debian.
@SGaist : Unfortunately we live in an imperfect world.
Thanks for your help - much appreciated.
I will mark this post as solved, even though it's not really, but I have no more time to spend on this.