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

/usr/bin/ld: lib/wxWidgets/lib/libwx_gtk3u_core-3.3.a(utilsx11.cpp.o): undefined reference to symbol 'XGetWindowAttributes' #644

Closed
mclaudt opened this issue May 22, 2024 · 0 comments · Fixed by mclaudt/treesheets#1 · May be fixed by #645

Comments

@mclaudt
Copy link

mclaudt commented May 22, 2024

First of all, many thanks for unbelievably comfort software!

While building under Ubuntu 20.04.3 LTS, ld error appears:

/usr/bin/ld: lib/wxWidgets/lib/libwx_gtk3u_core-3.3.a(utilsx11.cpp.o): undefined reference to symbol 'XGetWindowAttributes'
/usr/bin/ld: /lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/treesheets.dir/build.make:115: treesheets] Error 1
make[1]: *** [CMakeFiles/Makefile2:449: CMakeFiles/treesheets.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Steps to reproduce:

Assume we have Linux with git installed, and cloned the repo.

  1. cd treesheets

  2. cmake -S . -B _build -DCMAKE_BUILD_TYPE=Release

  3. cmake --build _build

Solution:

Add this section to CMakesLists.txt:

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    find_package(X11 REQUIRED) 
    target_link_libraries(treesheets PRIVATE ${X11_LIBRARIES})  
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant