kdudka / rrv

Radiosity Renderer and Visualizer
GNU General Public License v3.0
13 stars 1 forks source link

linking fails on Debian Bullseye #8

Closed claudeha closed 2 years ago

claudeha commented 2 years ago

DSO missing from command line for symbol XSync

solution is to add -lX11 to the CMakelists.txt for each of the executables' target link libraries.

btw I see the website has newer timestamps, but I haven't compared the code to know which is really the latest...

kdudka commented 2 years ago

When I tried to compile it on my system (running Gentoo Linux), I hit a different issue:

$ make
[  2%] Building CXX object CMakeFiles/rrv.dir/ArgumentParser.cpp.o
[  5%] Building CXX object CMakeFiles/rrv.dir/BarrelEntity.cpp.o
[  7%] Building CXX object CMakeFiles/rrv.dir/ConsoleProgressIndicator.cpp.o
[ 10%] Building CXX object CMakeFiles/rrv.dir/CuboidEntity.cpp.o
[ 12%] Building CXX object CMakeFiles/rrv.dir/Entity.cpp.o
[ 15%] Building CXX object CMakeFiles/rrv.dir/EntitySet.cpp.o
[ 17%] Building CXX object CMakeFiles/rrv.dir/FormFactorEngine.cpp.o
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/cstdint:35,
                 from /usr/include/GL/glew.h:225,
                 from /var/tmp/git/rrv/src/FormFactorEngine.h:37,
                 from /var/tmp/git/rrv/src/FormFactorEngine.cpp:21:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
   32 | #error This file requires compiler and library support \
      |  ^~~~~
In file included from /var/tmp/git/rrv/src/FormFactorEngine.h:37,
                 from /var/tmp/git/rrv/src/FormFactorEngine.cpp:21:
/usr/include/GL/glew.h:317:9: error: 'uint64_t' does not name a type; did you mean 'u_int64_t'?
  317 | typedef uint64_t GLuint64EXT;
      |         ^~~~~~~~
      |         u_int64_t
/usr/include/GL/glew.h:320:9: error: 'GLuint64EXT' does not name a type; did you mean 'GLint64EXT'?
  320 | typedef GLuint64EXT GLuint64;
      |         ^~~~~~~~~~~
      |         GLint64EXT
In file included from /var/tmp/git/rrv/src/FormFactorEngine.h:37,
                 from /var/tmp/git/rrv/src/FormFactorEngine.cpp:21:
/usr/include/GL/glew.h:3374:89: error: 'GLuint64' has not been declared
 3374 | typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params);
      |                                                                                         ^~~~~~~~
/usr/include/GL/glew.h:3688:94: error: 'GLuint64' has not been declared
 3688 | typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync GLsync, GLbitfield flags, GLuint64 timeout);
      |                                                                                              ^~~~~~~~
[...]

... which I was able to fix with the following patch:

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -78,7 +78,6 @@ macro(ADD_CXX_OPT opt_name opt)
 endmacro()

 # tweak warnings
-ADD_CXX_OPT("STD_CXX_98" "-std=c++98")
 ADD_CXX_OPT("PEDANTIC"   "-pedantic")
 ADD_CXX_OPT("W_ALL"      "-Wall")
 ADD_CXX_OPT("W_EXTRA"    "-Wextra")

I was not able to reproduce the issue with -lX11 though. Could you please open a pull request with the proposed change?

The time stamps on the website are artificial and the source code files most likely outdated. I guess I should remove them and refer to the GitHub project instead.

claudeha commented 2 years ago

I was not able to reproduce the issue with -lX11 though. Could you please open a pull request with the proposed change?

you're correct - I was on a wrong (outdated) branch. your master builds without problems. sorry for the noise.

kdudka commented 2 years ago

Glad to see it resolved!