sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

linux build error: GL/glu.h: No such file or directory

Open jonleivent opened this issue 3 years ago • 7 comments

I'm attempting to build v1.0.0 in Debian 10.11, using build_linux.sh. I get this when it tries to build mupdf:

    CC build/release/platform/gl/gl-annotate.o
In file included from thirdparty/freeglut/include/GL/freeglut.h:17,
                 from platform/gl/gl-app.h:14,
                 from platform/gl/gl-annotate.c:1:
thirdparty/freeglut/include/GL/freeglut_std.h:144:13: fatal error: GL/glu.h: No such file or directory
 #   include <GL/glu.h>
             ^~~~~~~~~~
compilation terminated.

I have tried deleting and re-cloning, thinking that maybe some files didn't transfer the first time, but still get the same error.

BTW: I already have debian's verison of mupdf installed (version 1.14.0+ds1-4+deb10u3). Is there a way I can build sioyek without rebuidling mupdf as a submodule, instead using this installed version?

jonleivent avatar Nov 04 '21 02:11 jonleivent

Hi, do you know which package in debian is providing GL/glu.h?

Endle avatar Nov 04 '21 04:11 Endle

Does installing libglu1-mesa-dev help? Version 1.14 of mupdf does not work with sioyek. We need some of the features added in 1.18. In fact we used to use the mupdf installed on the system instead of building it from source, but it caused a lot of compatibility issues so I definitely recommend building it from source.

ahrm avatar Nov 04 '21 07:11 ahrm

Here are my two cents.

Compiling mupdf is not a trivial job in most Linux distros. When compiling sioyek for Fedora Copr, I tried to compile the mupdf shipped as git submodule, but failed. My current solution is using the mupdf-devel shipped with Fedora, and added some hacks to compile sioyek.

There is also a AUR for arch users. Seems that they also used Arch's mupdf. I guess randomn4me has their own consideration.

Disclaimer: I haven't used Debian.

Now for the Debian case. As ahrm claimed, sioyek depends on newer mupdf. Therefore, you HAVE to compile mupdf on your side. It would be even harder, as the dependencies (runtime/build) of mupdf 1.18 may also expect newer versions, and I'm not sure if debian has shipped them yet.

I'm not sure if debian has a place for user-uploaded packages (Fedora has Copr, Arch has AUR). If so, there may be some insights for you.

Endle avatar Nov 04 '21 09:11 Endle

I installed libglu1-mesa-dev (9.0.0-2.1+b3), and this allows the build to get further. It now fails here:

    LINK build/release/mupdf-x11
Project MESSAGE: Warning: unknown QT: quickwidgets
Project MESSAGE: Warning: unknown QT: 3dcore
Project MESSAGE: Warning: unknown QT: 3danimation
Project MESSAGE: Warning: unknown QT: 3dextras
Project MESSAGE: Warning: unknown QT: 3dinput
Project MESSAGE: Warning: unknown QT: 3dlogic
Project MESSAGE: Warning: unknown QT: 3drender
Project MESSAGE: Warning: unknown QT: openglextensions
g++ -c -m64 -pipe -std=c++17 -O2 -Wall -W -D_REENTRANT -DQT_3DCORE_LIB -DQT_3DANIMATION_LIB -DQT_3DEXTRAS_LIB -DQT_3DINPUT_LIB -DQT_3DLOGIC_LIB -DQT_3DRENDER_LIB -DQT_OPENGL_LIB -DQT_OPENGLEXTENSIONS_LIB -DQT_QUICKWIDGETS_LIB -DQT_SQL_LIB -DQT_WIDGETS_LIB -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtSql -I/usr/include/qt4 -Ipdf_viewer -Imupdf/include -Izlib -I/usr/X11R6/include -I. -o book.o pdf_viewer/book.cpp
In file included from pdf_viewer/book.cpp:1:
pdf_viewer/book.h:7:10: fatal error: qopengl.h: No such file or directory
 #include <qopengl.h>
          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:257: book.o] Error 1

jonleivent avatar Nov 04 '21 14:11 jonleivent

Apparently, to get qopengl.h on Debian 10.11, I need to install qtbase5-dev. After doing that, I still get the same error as above about missing qopengl.h. Apparently because installing qtbase5-dev puts this include at the path /usr/include/x86_64-linux-gnu/qt5/QtGui/qopengl.h, which the build is probably not using.

jonleivent avatar Nov 04 '21 14:11 jonleivent

On Ubuntu, I got a similar error during build: fatal error: GL/gl.h: No such file or directory which was resolved by installing apt install freeglut3-dev.

solarchemist avatar Nov 07 '21 19:11 solarchemist

I installed freeglut3-dev, but still get the same error about missing gopengl.h.

jonleivent avatar Nov 08 '21 18:11 jonleivent

I am closing this as this is not really a sioyek issue. You need to install the proper package containing these headers for your distribution. It can be different for different distributions, you need to google it.

ahrm avatar Jan 26 '24 13:01 ahrm