paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

Error on building #140

Closed Joilnen closed 2 years ago

Joilnen commented 2 years ago

is glut or freeglut a dependence ?

[ 14%] Built target glutil [ 14%] Building C object glsdk/CMakeFiles/freeglut.dir/freeglut/src/freeglut_callbacks.c.o In file included from /home/joilnen/ogre3d_devel/gltut/glsdk/freeglut/src/freeglut_callbacks.c:29: /home/joilnen/ogre3d_devel/gltut/glsdk/freeglut/src/freeglut_internal.h:32:14: fatal error: config.h: No such file or directory 32 | # include "config.h" | ^~~~~~ compilation terminated. make[2]: [glsdk/CMakeFiles/freeglut.dir/build.make:76: glsdk/CMakeFiles/freeglut.dir/freeglut/src/freeglut_callbacks.c.o] Error 1 make[1]: [CMakeFiles/Makefile2:1786: glsdk/CMakeFiles/freeglut.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

paroj commented 2 years ago

freeglut is built as part of the project. Are you on Linux? Then likely this command failed: https://github.com/paroj/gltut/blob/2f385318a2fd6d2081639e457bf20b8921ff7bd9/glsdk/CMakeLists.txt#L8

Joilnen commented 2 years ago

yes on linux, archlinux dist

paroj commented 2 years ago

can you run that command manually in glsdk/freeglut

Joilnen commented 2 years ago

works

sh ./configure joilnen@sutherland freeglut]$ sh ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no ... config.status: creating progs/demos/One/Makefile config.status: creating progs/demos/shapes/Makefile config.status: creating progs/demos/smooth_opengl3/Makefile config.status: creating progs/demos/spaceball/Makefile config.status: creating src/Makefile config.status: creating config.h config.status: config.h is unchanged config.status: executing depfiles commands [joilnen@sutherland freeglut]$

paroj commented 2 years ago

try building again now

Joilnen commented 2 years ago

I got this error now [joilnen@sutherland gltut]$ cmake --build build/ [ 2%] Built target glload [ 9%] Built target glimg [ 14%] Built target glutil /usr/include/c++/11.2.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::front() [with _Tp = cmGccStyleDependency; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::reference = cmGccStyleDependency&]: Assertion '!this->empty()' failed. make[2]: [glsdk/CMakeFiles/freeglut.dir/build.make:477: glsdk/CMakeFiles/freeglut.dir/depend] Aborted (core dumped) make[1]: [CMakeFiles/Makefile2:1785: glsdk/CMakeFiles/freeglut.dir/all] Error 2 make: *** [Makefile:91: all] Error 2

paroj commented 2 years ago

you probably have to either update freeglut manually or use an older compiler