cdcseacave / openMVS

open Multi-View Stereo reconstruction library
http://cdcseacave.github.io
GNU Affero General Public License v3.0
3.17k stars 891 forks source link

undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag' #1031

Open jiapei100 opened 11 months ago

jiapei100 commented 11 months ago

Describe the bug Failed to build Viewer out, as:

[100%] Linking CXX executable ../../bin/Viewer
cd ....../openMVS/build_22.04/apps/Viewer && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/Viewer.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++17 -fPIC   -W -Wall -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Winit-self -Wsign-promo -Wreorder -Wno-undef -Wno-switch -Wno-switch-enum -Wno-switch-default -Wno-implicit-fallthrough -Wno-comment -Wno-narrowing -Wno-attributes -Wno-ignored-attributes -Wno-maybe-uninitialized -Wno-enum-compare -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-result -Wno-unused-function -Wno-unused-parameter -Wno-delete-incomplete -Wno-int-in-bool-context -fdiagnostics-show-option -ftemplate-backtrace-limit=0 -Wno-long-long -pthread -fno-omit-frame-pointer -ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -fopenmp -O3 -DNDEBUG  -DNDEBUG CMakeFiles/Viewer.dir/Camera.cpp.o CMakeFiles/Viewer.dir/Common.cpp.o CMakeFiles/Viewer.dir/Image.cpp.o CMakeFiles/Viewer.dir/Scene.cpp.o CMakeFiles/Viewer.dir/Viewer.cpp.o CMakeFiles/Viewer.dir/Window.cpp.o -o ../../bin/Viewer   -L/usr/local/cuda/lib64  -Wl,-rpath,/usr/local/cuda/lib64:....../openMVS/build_22.04/lib:/usr/local/lib: ../../lib/libMVS.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGLEW.so /usr/lib/x86_64-linux-gnu/libglfw.so.3.3 /usr/lib/x86_64-linux-gnu/libpython3.10.so -Wl,-rpath-link,....../openMVS/build_22.04/lib:/usr/local/lib 
/usr/bin/ld: CMakeFiles/Viewer.dir/Scene.cpp.o: undefined reference to symbol '_Z10_vscprintfPKcP13__va_list_tag'
/usr/bin/ld: ....../openMVS/build_22.04/lib/libCommon.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [apps/Viewer/CMakeFiles/Viewer.dir/build.make:215: bin/Viewer] Error 1
make[2]: Leaving directory '....../openMVS/build_22.04'
make[1]: *** [CMakeFiles/Makefile2:796: apps/Viewer/CMakeFiles/Viewer.dir/all] Error 2
make[1]: Leaving directory '....../openMVS/build_22.04'
make: *** [Makefile:149: all] Error 2

To Reproduce Just trying to build openMVS under Ubuntu 22.04.

Expected behavior Successfully built

Screenshots N/A

Desktop (please complete the following information):

Additional context N/A

Did anybody meet the same issue???

cdcseacave commented 11 months ago

did u follow build instructions or some custom setup?

jiapei100 commented 11 months ago

@cdcseacave

Yeah... Strictly followed... https://github.com/cdcseacave/openMVS/wiki/Building

Hmmm... Still the same

jiapei100 commented 11 months ago

And, @cdcseacave I came acrros https://github.com/cdcseacave/openMVS/issues/364, where I found my previous solution :+1:

Do NOT enable BUILD_SHARED_LIBS, namely, set -DBUILD_SHARED_LIBS=OFF.

Why it wouldn't even work with shared libraries? Is there a way to debug Viewer?

Let me try...

cdcseacave commented 11 months ago

something is not right on your setup/commands, as you can see in the CI it builds fine on all 3 platforms: https://github.com/cdcseacave/openMVS/actions/runs/5458397986/job/14777391000

tkircher commented 5 months ago

Just to follow up on this, openMVS cannot be built with shared libraries, and by default that option is disabled.