Hello Victor, On 05/23/2012 03:42 AM, Victor Haefner wrote:
I recently switched to Ubuntu 12.4 (64bit) and I am trying to compile OSG2 but I get the following error:[100%] Built target testBackgroundLoader Linking CXX executable ../../bin/testVTK /usr/bin/ld: CMakeFiles/testVTK.dir/testVTK.cpp.o: undefined reference to symbol 'vtkStructuredGridReader::GetOutput()' /usr/bin/ld: note: 'vtkStructuredGridReader::GetOutput()' is defined in DSO /usr/lib/libvtkIO.so.5.8 so try adding it to the linker command line /usr/lib/libvtkIO.so.5.8: could not read symbols: Invalid operation collect2: ld gab 1 als Ende-Status zurück make[2]: *** [bin/testVTK] Fehler 1 make[1]: *** [Test/OSGContribVTK/CMakeFiles/testVTK.dir/all] Fehler 2 make: *** [all] Fehler 2 From what I understand this is due to a ld patch: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
yes, sounds like we are not linking against all vtk libs we need.
I am not very experienced with cmake.. what I id: mkdir build cd build cmake .. make && make install (in a script with sudo) How would it be possible to add that linker flag -lvtkIO ?
I think the attached patch should fix it. Can you give it a try, since it's difficult for me to reproduce the problem? Thank you!
Cheers, Carsten
diff --git a/CMakeLists.txt b/CMakeLists.txt index e661c81..dd28192 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -686,7 +686,7 @@ IF(NOT OSG_BUILD_DEPENDEND) IF(VTK_FOUND) OSG_SET(OSG_WITH_VTK 1) - OSG_SET(OSG_VTK_LIBS vtkRendering) + OSG_SET(OSG_VTK_LIBS "vtkCommon;vtkFiltering;vtkGraphics;vtkIO;vtkRendering") OSG_ADD_OPT(OSG_VTK_LIBS) OSG_ADD_OPT(VTK_LIBRARY_DIRS) diff --git a/Source/Contrib/VTK/CMakeLists.Lib.OSGContribVTK.txt b/Source/Contrib/VTK/CMakeLists.Lib.OSGContribVTK.txt index 2f69ce9..9e83e73 100644 --- a/Source/Contrib/VTK/CMakeLists.Lib.OSGContribVTK.txt +++ b/Source/Contrib/VTK/CMakeLists.Lib.OSGContribVTK.txt @@ -32,7 +32,7 @@ SET(${PROJECT_NAME}_DEP_LIB OSG_VTK_LIBS) SET(${PROJECT_NAME}_DEP_LIBDIR VTK_LIBRARY_DIRS) SET(${PROJECT_NAME}_DEP_INCDIR VTK_INCLUDE_DIRS) -# SET(${PROJECT_NAME}_DEP_TEST_LIB) +SET(${PROJECT_NAME}_DEP_TEST_LIB OSG_VTK_LIBS) # SET(${PROJECT_NAME}_DEP_TEST_LIBDIR) # SET(${PROJECT_NAME}_DEP_TEST_INCDIR OSG_GLUT_INC_DIR)
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users