-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Could NOT find X11 (missing: X11_X11_LIB) #1957
Comments
I'm not sure exactly what is causing the error above but you probably want to install the full If the problem remains with that package installed then that's definitely a bug somewhere. |
root@wangshucheng:/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build# sudo apt-get install xorg-dev Thank you for your answer. But I think xorg-dev is also completely installed. |
You're running Ubuntu on WSL? I don't think I've ever seen CMake fail to find X11 installed from the regular packages on a Debian derived system so I really don't know what could be causing this. |
oof. I'm on the same boat with WSL2. I guess it's a WSL thing. |
It could be a WSL thing but also I use WSL daily for building and testing the X11 backend and have not seen this issue. |
For me this happened when trying to compile with clang. With gcc it worked fine. |
Same thing here. In my setup I am using CMake with CMake Presets. My CMakePresets.json looks as follows:
As you can see I have two presets. One for gcc and one for clang. When I compile glfw with the gcc preset I have no problems at all. When I switch to clang I get an error during the cmake configuration process:
I compiled the llvm project in my user directory and pointing to the clang and lld executables in the cmake preset. For me it is quite confusing that this issue is happening during the cmake configuration process. For me the only reasonable explanation is that cmake gets the path it searches for libraries in from the compiler itself. That would explain why this happens when I switch the compiler but shows up as an issue during cmake configuration. |
I used cmake 3.22.3 and ran into the same problem. I switched back to cmake 3.21.6 and every thing is OK. |
Damn it. Got same errro here. I have installed libxorg-dev libx11-dev everything it needed, but glfw just can not found it. Any solution? Mine cmake 3.22.3 |
btw, downgrade or upgrade cmake doesn't help at all. |
I don't know why CMake is failing to find In the meantime, if you know where the library is on your system you should be able to work around this issue with CMAKE_LIBRARY_PATH by adding |
For anyone got this error, recommend using works like a charm. And what even more strangely, if using this, it will found x11 again...... |
This issue appears to be reproducible with Clang 14, but not with Clang 12 (!?) Update: Clang 13 also works (non-reproducable) |
Damn it! Now I am really doubt this logic ,this X11 thing, it's just like a strange shit. |
OK, I found the problem, the f**k guilty guy behind it was anaconda..... this guy just hide all lib from my system.... Be note even if you deactivated it, it still effect your system. |
Same issue here, |
For me regardless of which compiler I use the issue still persists.
I am on Ubuntu 20.0.1. The more I look at this issue the more I think it is related to CMake or the debian os. Source code here. Update: This problem only occurs for me when I am using a compiler other than gcc OR I am trying to compile my project, which then compiles glfw. If I open a standalone glfw project everything works as intended with gcc. Another update FIXED: I fixed the problem by just including the |
你可以试一下这个: |
TL;DR: My issues went away after updating to CMake to If that still doesn't work, consider setting I spent some time investigating why
The documentation for Low and behold,
I tried digging further into where |
If you're building from glfw master you don't need libx11.so present anymore. This still fails but you can just do |
With the findings of @ben-clayton above, I believe this can be closed as a resolved external bug. |
wangshucheng@wangshucheng:/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build$ sudo apt-get install libx11-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libx11-dev is already the newest version (2:1.6.9-2ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
wangshucheng@wangshucheng:/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build$ cmake ..
-- Using X11 for window creation
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find X11 (missing: X11_X11_LIB)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.16/Modules/FindX11.cmake:366 (find_package_handle_standard_args)
CMakeLists.txt:203 (find_package)
-- Configuring incomplete, errors occurred!
See also "/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build/CMakeFiles/CMakeError.log".
wangshucheng@wangshucheng:/mnt/c/Users/wangsc/Downloads/glfw/glfw-3.3.4/build$ sudo apt-cache search x11-dev
libx11-dev - X11 client-side library (development headers)
libxkbcommon-x11-dev - library to create keymaps with the XKB X11 protocol - development files
libghc-gi-gdkx11-dev - GDKX11 bindings
libghc-x11-dev - Haskell X11 binding for GHC
libnx-x11-dev - nxagent's libNX_X11 client-part library (development headers)
librust-cairo-sys-rs+x11-dev - FFI bindings to libcairo - feature "x11"
librust-x11-dev - X11 library bindings for Rust - Rust source code
The text was updated successfully, but these errors were encountered: