Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to link wb_view (with error: undefined reference to symbol 'glGetFloatv') #86

Open
yanlinlin82 opened this issue Jan 27, 2025 · 2 comments

Comments

@yanlinlin82
Copy link

After run:

mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D WORKBENCH_MESA_DIR=/usr -D WORKBENCH_USE_QT5=TRUE ../workbench/src
nice make -j8

It failed with errors:

...
[ 99%] Building CXX object GuiQt/CMakeFiles/GuiQt.dir/WuQWidgetDisabler.cxx.o
[ 99%] Building CXX object GuiQt/CMakeFiles/GuiQt.dir/WuQWidgetObjectGroup.cxx.o
[ 99%] Building CXX object GuiQt/CMakeFiles/GuiQt.dir/WuQtUtilities.cxx.o
[ 99%] Building CXX object GuiQt/CMakeFiles/GuiQt.dir/ZipSceneFileDialog.cxx.o                                                                                                                                                  [ 99%] Linking CXX static library libGuiQt.a
[ 99%] Built target GuiQt
[ 99%] Generating qrc_help_resources.cpp
[ 99%] Generating qrc_data_resources.cpp
[ 99%] Generating qrc_general_resources.cpp
[ 99%] Generating qrc_gui_resources.cpp
[ 99%] Building CXX object Tests/CMakeFiles/test_driver.dir/test_driver.cxx.o
[ 99%] Building CXX object Desktop/CMakeFiles/wb_view.dir/desktop.cxx.o
[ 99%] Building CXX object Desktop/CMakeFiles/wb_view.dir/qrc_gui_resources.cpp.o
[ 99%] Building CXX object Desktop/CMakeFiles/wb_view.dir/qrc_general_resources.cpp.o
[ 99%] Building CXX object Desktop/CMakeFiles/wb_view.dir/qrc_help_resources.cpp.o
[ 99%] Building CXX object Desktop/CMakeFiles/wb_view.dir/qrc_data_resources.cpp.o
[ 99%] Linking CXX executable test_driver
/usr/bin/ld: ../CZIlib/CZIJxrDecode/libCZIJxrDecode.a(strenc.c.o): in function `StrIOEncInit':
strenc.c:(.text+0xfa4): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: ../Brain/libBrain.a(BrainOpenGLVolumeObliqueSliceDrawing.cxx.o): undefined reference to symbol 'glGetFloatv'
/usr/bin/ld: /lib/x86_64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Tests/CMakeFiles/test_driver.dir/build.make:134: Tests/test_driver] Error 1
make[1]: *** [CMakeFiles/Makefile2:1520: Tests/CMakeFiles/test_driver.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Linking CXX executable wb_view
/usr/bin/ld: ../CZIlib/CZIJxrDecode/libCZIJxrDecode.a(strenc.c.o): in function `StrIOEncInit':
strenc.c:(.text+0xfa4): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
[100%] Built target wb_view
yanlinlin82 added a commit to yanlinlin82/workbench that referenced this issue Jan 27, 2025
…sity#86).

Ensures that OpenGL libraries are linked when building test targets, which may be necessary for proper rendering and testing of graphics-related functionality.
@yanlinlin82
Copy link
Author

This issue could be addressed in PR #87

@coalsont
Copy link
Member

The tests are intended to be run non-interactively, and it appears the cmake file already links the OSMesa libraries. OSMesa is needed for -show-scene, so we always set it up with that, which I guess is why we haven't seen this issue. Looks like wb_command has a conditional to decide whether to link to OSMesa or openGL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants