无法安装 libsdl2-dev 或 cmake glfw..(libxinerama-dev 问题)

无法安装 libsdl2-dev 或 cmake glfw..(libxinerama-dev 问题)

因此,我打算在切换到 Ubuntu 后继续学习 Opengl,我尝试按照这个解释来编译 glfw 并使用它,但是得到了这个:

-- Using X11 for window creation
-- Using GLX for context creation
CMake Error at CMakeLists.txt:268 (message):
  The Xinerama library and headers were not found


-- Configuring incomplete, errors occurred!

这是CMake错误日志这是CMake输出.log

好的,在 glfw 失败后,我转向 libsdl2:

sudo apt-get install libsdl2-dev

结果令人震惊。

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsdl2-dev : Depends: libxinerama-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该怎么办?我尝试过这个:

sudo apt-get install libxinerama-dev

我得到的结果是这样的:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libxinerama-dev : Depends: libxinerama1 (= 2:1.1.3-1) but 2:1.1.3-1+b1 is to be installed
E: Unable to correct problems, you have held broken packages.

提前致谢。

答案1

我在安装库时也遇到了同样的问题glfw。这是我解决的方法:

  1. 我使用以下命令导航到我的主目录:

    cd ~
    
  2. 然后我跑了:

    sudo apt-get install libxinerama-dev
    
  3. 我再次导航到目录glfw并运行:

    cmake -G "Unix Makefiles"
    
  4. 这次错误是xcursor lib not found。所以我重复了上述步骤并xcursor使用以下命令安装了库:

    sudo apt-get install libxcursor-dev
    
  5. 此后我导航回glfw 目录并且cmake命令成功执行。

相关内容