kdudka / rrv

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

undefined reference to symbol 'XSync' #5

Closed stolk closed 7 years ago

stolk commented 7 years ago

The building of rrv-compute fails because XSync symbol is not found.

$ cmake .
-- The CXX compiler identification is GNU 5.4.0
-- The C compiler identification is GNU 5.4.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenGL: /home/bram/lib/libGL.so  
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
-- Performing Test HAVE_STD_CXX_98
-- Performing Test HAVE_STD_CXX_98 - Success
-- Performing Test HAVE_PEDANTIC
-- Performing Test HAVE_PEDANTIC - Success
-- Performing Test HAVE_W_ALL
-- Performing Test HAVE_W_ALL - Success
-- Performing Test HAVE_W_EXTRA
-- Performing Test HAVE_W_EXTRA - Success
-- Performing Test HAVE_W_D4305
-- Performing Test HAVE_W_D4305 - Failed
-- Performing Test HAVE_M_MMX
-- Performing Test HAVE_M_MMX - Success
-- Performing Test HAVE_F_EXPENSIVE_OPTIMIZATIONS
-- Performing Test HAVE_F_EXPENSIVE_OPTIMIZATIONS - Success
-- Performing Test HAVE_F_FAST_MATH
-- Performing Test HAVE_F_FAST_MATH - Success
-- Performing Test HAVE_F_OMIT_FRAME_POINTER
-- Performing Test HAVE_F_OMIT_FRAME_POINTER - Success
-- Performing Test HAVE_F_OPENMP
-- Performing Test HAVE_F_OPENMP - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bram/src/rrv/src
bram@ubuntu64:~/src/rrv/src$ make
Scanning dependencies of target rrv
[  2%] Building CXX object CMakeFiles/rrv.dir/ArgumentParser.cpp.o
[  4%] Building CXX object CMakeFiles/rrv.dir/BarrelEntity.cpp.o
[  7%] Building CXX object CMakeFiles/rrv.dir/ConsoleProgressIndicator.cpp.o
[  9%] Building CXX object CMakeFiles/rrv.dir/CuboidEntity.cpp.o
[ 12%] Building CXX object CMakeFiles/rrv.dir/Entity.cpp.o
[ 14%] Building CXX object CMakeFiles/rrv.dir/EntitySet.cpp.o
[ 17%] Building CXX object CMakeFiles/rrv.dir/FormFactorEngine.cpp.o
[ 19%] Building CXX object CMakeFiles/rrv.dir/FormFactorHemicube.cpp.o
[ 21%] Building CXX object CMakeFiles/rrv.dir/FormFactorView.cpp.o
[ 24%] Building CXX object CMakeFiles/rrv.dir/GlobeEntity.cpp.o
[ 26%] Building CXX object CMakeFiles/rrv.dir/PatchCache.cpp.o
[ 29%] Building CXX object CMakeFiles/rrv.dir/PatchCacheLine.cpp.o
[ 31%] Building CXX object CMakeFiles/rrv.dir/PatchSequenceEnumerator.cpp.o
[ 34%] Building CXX object CMakeFiles/rrv.dir/PatchRandomAccessEnumerator.cpp.o
[ 36%] Building CXX object CMakeFiles/rrv.dir/ProgressObserverMultiStep.cpp.o
[ 39%] Building CXX object CMakeFiles/rrv.dir/ProgressSubjectMultiStep.cpp.o
[ 41%] Building CXX object CMakeFiles/rrv.dir/RadiosityRenderer.cpp.o
[ 43%] Building CXX object CMakeFiles/rrv.dir/Scene.cpp.o
[ 46%] Building CXX object CMakeFiles/rrv.dir/TeapotEntity.cpp.o
[ 48%] Building CXX object CMakeFiles/rrv.dir/TeapotEntityDef.cpp.o
[ 51%] Building CXX object CMakeFiles/rrv.dir/TransformMatrix.cpp.o
[ 53%] Building CXX object CMakeFiles/rrv.dir/TriangleEntity.cpp.o
[ 56%] Building CXX object CMakeFiles/rrv.dir/TriangleSet.cpp.o
[ 58%] Building CXX object CMakeFiles/rrv.dir/TriangleSetExt.cpp.o
[ 60%] Building CXX object CMakeFiles/rrv.dir/xmlParser.cpp.o
/home/bram/src/rrv/src/xmlParser.cpp: In static member function ‘static XMLNode XMLNode::parseFile(const char*, const char*, XMLResults*)’:
/home/bram/src/rrv/src/xmlParser.cpp:1682:21: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
     fread(buf,l,1,f);
                     ^
[ 63%] Building CXX object CMakeFiles/rrv.dir/XMLNames.cpp.o
[ 65%] Building CXX object CMakeFiles/rrv.dir/XMLHelper.cpp.o
[ 68%] Building CXX object CMakeFiles/rrv.dir/XMLBodyReader.cpp.o
[ 70%] Building CXX object CMakeFiles/rrv.dir/XMLWrapper.cpp.o
[ 73%] Building CXX object CMakeFiles/rrv.dir/XMLWriter.cpp.o
[ 75%] Linking CXX static library librrv.a
[ 75%] Built target rrv
Scanning dependencies of target rrv-compute
[ 78%] Building CXX object CMakeFiles/rrv-compute.dir/rrv-compute.cpp.o
[ 80%] Building CXX object CMakeFiles/rrv-compute.dir/ComputeArguments.cpp.o
[ 82%] Building CXX object CMakeFiles/rrv-compute.dir/Visualizer.cpp.o
[ 85%] Linking CXX executable rrv-compute
/usr/bin/ld: librrv.a(FormFactorEngine.cpp.o): undefined reference to symbol 'XSync'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/rrv-compute.dir/build.make:152: recipe for target 'rrv-compute' failed
make[2]: *** [rrv-compute] Error 1
kdudka commented 7 years ago

Thank you for reporting the bug! I have pushed a commit that I believe will fix it. Please try the latest upstream git HEAD. If it does not help, please build it using make VERBOSE=1 and attach the output.

stolk commented 7 years ago

Another undefined symbol: _glapi_tls_Dispatch

/usr/bin/cmake -E cmake_link_script CMakeFiles/rrv-compute.dir/link.txt --verbose=1
/usr/bin/c++      CMakeFiles/rrv-compute.dir/rrv-compute.cpp.o CMakeFiles/rrv-compute.dir/ComputeArguments.cpp.o CMakeFiles/rrv-compute.dir/Visualizer.cpp.o  -o rrv-compute -rdynamic librrv.a -fopenmp -lGLEW -lGLU -lGL -lX11 -lGLU /home/bram/lib/libGL.so -lglut -lXmu -lXi -Wl,-rpath,/home/bram/lib 
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libGL.so: undefined reference to `_glapi_tls_Dispatch'
collect2: error: ld returned 1 exit status
CMakeFiles/rrv-compute.dir/build.make:152: recipe for target 'rrv-compute' failed
make[2]: *** [rrv-compute] Error 1
stolk commented 7 years ago

Sorry, strike that previous comment: it was picking up a different libGL than I expected. rrv-compute now builds.

Currently looking into a new error regarding glfw3 header.