openMVS icon indicating copy to clipboard operation
openMVS copied to clipboard

build error when -DBUILD_SHARED_LIBS=ON

Open louyanyang opened this issue 4 years ago • 3 comments

@cdcseacave hi, it's success when building static lib and exe, but is error when building shared one. Is there any advice you'd like to give me?

my env: -- Boost version: 1.65.1 -- Found the following Boost libraries: -- iostreams -- program_options -- filesystem -- system -- serialization -- regex -- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "2.91.0") -- Eigen 3.4.0 found (include: /usr/local/include/eigen3) -- Found OpenCV: /usr/local (found version "4.5.0") -- OpenCV 4.5.0 found (include: /usr/local/include/opencv4) -- VCG found (include: /home/lyy/vcglib) -- GLEW found (include: /usr/include)

the error: [ 91%] Linking CXX executable ../../bin/RefineMesh [ 93%] Linking CXX executable ../../bin/DensifyPointCloud /usr/bin/ld: CMakeFiles/RefineMesh.dir/RefineMesh.cpp.o: undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag' //home/lyy/openMVS_build/lib/libCommon.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/RefineMesh/CMakeFiles/RefineMesh.dir/build.make:95: recipe for target 'bin/RefineMesh' failed make[2]: *** [bin/RefineMesh] Error 1 CMakeFiles/Makefile2:622: recipe for target 'apps/RefineMesh/CMakeFiles/RefineMesh.dir/all' failed make[1]: *** [apps/RefineMesh/CMakeFiles/RefineMesh.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... /usr/bin/ld: CMakeFiles/DensifyPointCloud.dir/DensifyPointCloud.cpp.o: undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag' //home/lyy/openMVS_build/lib/libCommon.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/build.make:95: recipe for target 'bin/DensifyPointCloud' failed make[2]: *** [bin/DensifyPointCloud] Error 1 CMakeFiles/Makefile2:512: recipe for target 'apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all' failed make[1]: *** [apps/DensifyPointCloud/CMakeFiles/DensifyPointCloud.dir/all] Error 2 [ 94%] Linking CXX executable ../../bin/TextureMesh /usr/bin/ld: CMakeFiles/TextureMesh.dir/TextureMesh.cpp.o: undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag' //home/lyy/openMVS_build/lib/libCommon.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/TextureMesh/CMakeFiles/TextureMesh.dir/build.make:95: recipe for target 'bin/TextureMesh' failed make[2]: *** [bin/TextureMesh] Error 1 CMakeFiles/Makefile2:677: recipe for target 'apps/TextureMesh/CMakeFiles/TextureMesh.dir/all' failed make[1]: *** [apps/TextureMesh/CMakeFiles/TextureMesh.dir/all] Error 2 [ 96%] Linking CXX executable ../../bin/InterfaceMetashape /usr/bin/ld: CMakeFiles/InterfaceMetashape.dir/InterfaceMetashape.cpp.o: undefined reference to symbol '_ZNK8tinyxml27XMLNode17FirstChildElementEPKc' //home/lyy/openMVS_build/lib/libIO.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/InterfaceMetashape/CMakeFiles/InterfaceMetashape.dir/build.make:95: recipe for target 'bin/InterfaceMetashape' failed make[2]: *** [bin/InterfaceMetashape] Error 1 CMakeFiles/Makefile2:457: recipe for target 'apps/InterfaceMetashape/CMakeFiles/InterfaceMetashape.dir/all' failed make[1]: *** [apps/InterfaceMetashape/CMakeFiles/InterfaceMetashape.dir/all] Error 2 [ 98%] Linking CXX executable ../../bin/ReconstructMesh /usr/bin/ld: CMakeFiles/ReconstructMesh.dir/ReconstructMesh.cpp.o: undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag' //home/lyy/openMVS_build/lib/libCommon.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/build.make:95: recipe for target 'bin/ReconstructMesh' failed make[2]: *** [bin/ReconstructMesh] Error 1 CMakeFiles/Makefile2:567: recipe for target 'apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/all' failed make[1]: *** [apps/ReconstructMesh/CMakeFiles/ReconstructMesh.dir/all] Error 2 [100%] Linking CXX executable ../../bin/InterfaceCOLMAP /usr/bin/ld: CMakeFiles/InterfaceCOLMAP.dir/InterfaceCOLMAP.cpp.o: undefined reference to symbol '_ZTVN7SEACAVE6CImageE' //home/lyy/openMVS_build/lib/libIO.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/build.make:95: recipe for target 'bin/InterfaceCOLMAP' failed make[2]: *** [bin/InterfaceCOLMAP] Error 1 CMakeFiles/Makefile2:402: recipe for target 'apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/all' failed make[1]: *** [apps/InterfaceCOLMAP/CMakeFiles/InterfaceCOLMAP.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

louyanyang avatar Jan 13 '22 03:01 louyanyang

I'd like to help, but I don't have experience with the linux build system

cdcseacave avatar Jan 18 '22 06:01 cdcseacave

I have the similar issue. After setting the -DBUILD_SHARED_LIBS=OFF, it works.

JetBelson avatar Jun 13 '22 04:06 JetBelson

呵呵,我(娄艳阳)已收到您的信,祝你事事顺心,快乐相随

louyanyang avatar Jun 13 '22 04:06 louyanyang