0

I've been trying for a while to get them working. After installing the library (via tarball) and installing every dependency I found needed via cmake-gui, I managed to make the examples and some 2D demos work.

I can run the triangulations and polygon demos, but when I try to make the Polyhedron demo, it gets to 13% and it throws the following error:

Scanning dependencies of target scene_polyhedron_item
[ 13%] Building CXX object CMakeFiles/scene_polyhedron_item.dir/Scene_polyhedron_item.cpp.o
[ 13%] Building CXX object CMakeFiles/scene_polyhedron_item.dir/scene_polyhedron_item_automoc.cpp.o
Linking CXX shared library libscene_polyhedron_item.so
/usr/bin/ld: /usr/local/lib/x86_64-linux-gnu/libCGAL.a(all_files.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/x86_64-linux-gnu/libCGAL.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libscene_polyhedron_item.so] Error 1
make[1]: *** [CMakeFiles/scene_polyhedron_item.dir/all] Error 2
make: *** [all] Error 2

I've googled similar errors, but I can't seem to replicate any of the answers into this. I tried adding an -fPIC flag on the CMakeLists.txt, and the error persists.

Using the cmake-gui (with which I got to get everything else working) I notice that only the QGLViewer-debug package is missing. I tried to find it to no avail, and failed to understand how to make a second copy of the package in order to make one a debug version, and also failed to understand how to turn the normal version of the package into the debuf version. And I also fail to see if this has anything to do with the error itself.

As a side notice, the AABB tree example Seg Faults on start, with no errors on the cmake/make area.

I don't know what to do by this point. I really need to see the 3D demos working on this computer to make sure I can work with this library.

  • It can be a problem with the version of QGLViewer you use. You need to use QGLViewer QT5 version. This type of error could come because you use QGLViewer QT4 version. To be sure you need to say which is your OS and how did you install QGLViewer. – gdamiand Mar 07 '17 at 22:17
  • I'm using Mint Cinammon "Rafaela". I did: sudo apt-get install libqglviewer-dev – Steffan Wiche Mar 07 '17 at 22:25
  • I don't know which version it is. Try to remove this version, and install it by hand. Be sure to use qmake version QT5 when you compile libqglviewer. – gdamiand Mar 07 '17 at 22:35
  • I'll try this and get back to you. – Steffan Wiche Mar 07 '17 at 22:43
  • If it is trying to link with libCGAL.a, it means that it did not compile libCGAL.so. Did you explicitly ask for that? Was there any indication by cmake that this would happen? You could also try CGAL's header-only mode to work around this. – Marc Glisse Mar 07 '17 at 23:25
  • Marc Glisse: All I've done is try to run the demos as explained on the tutorial. I did not input any command or specification other than running the gui to check what dependency is missing. How do I use the header-only mode? – Steffan Wiche Mar 10 '17 at 18:45
  • gdamiand: My QGLViewer was using the QT5 version. Sepcifically the 5.2.1 version. I've been trying to switch to the 5.3 version, but I haven't found a way to make this work. – Steffan Wiche Mar 10 '17 at 18:46
  • I managed to solve this. I'm not exactly sure what caused it, but I formatted my computer and started over, and got it working somehow. – Steffan Wiche Mar 11 '17 at 21:03

0 Answers0