linux 上的 raylib 安装有问题

a problem with the raylib installation on linux

我正在使用基于 ubuntu 的发行版 Peppermint 10

所以我执行了以下命令here,一切顺利,直到这个


(the input)

cmake -DBUILD_SHARED_LIBS=ON ..

(the output)

-- Testing if -Werror=pointer-arith can be used -- compiles

-- Testing if -Werror=implicit-function-declaration can be used -- compiles

-- Testing if -fno-strict-aliasing can be used -- compiles

-- Using raylib's GLFW

-- Using X11 for window creation

-- Audio Backend: miniaudio

-- Building raylib shared library

-- Generated build type: Debug

-- Compiling with the flags:

-- PLATFORM=PLATFORM_DESKTOP

-- GRAPHICS=GRAPHICS_API_OPENGL_33

-- Building examples is enabled

-- Testing if -std=c11 can be used -- compiles

-- Configuring done

CMake Error at src/CMakeLists.txt:57 (add_library):

Error evaluating generator expression:


$<TARGET_OBJECTS:glfw>


Objects of target "glfw" referenced but is not an OBJECT library.



CMake Error: CMake can not determine linker language for target: raylib

CMake Error: Cannot determine link language for target "raylib".

-- Generating done

-- Build files have been written to: /home/anas/raylib/build

我该如何修复这些 cmake 错误?

但后来我忽略了这些认为这是正常的但是当我尝试执行以下命令时


(the command aka the input)

make

(the output)

[ 7%] Built target glfw

make[2]: *** No rule to make target 'raylib/CMakeFiles/raylib.dir/build'. Stop.

CMakeFiles/Makefile2:87: recipe for target 'raylib/CMakeFiles/raylib.dir/all' failed

make[1]: *** [raylib/CMakeFiles/raylib.dir/all] Error 2

Makefile:162: recipe for target 'all' failed

make: *** [all] Error 2

当我尝试时它显示相同的东西 sudo make install

帮助 我仍然不知道这里有什么问题 顺便说一句,我正在关注 wiki here

这样做:

  1. sudo apt 安装 g++
  2. sudo apt install cmake(应该是3.11或更高版本)
  3. 下载到您的项目文件夹 ex。 'new-game' 文件夹 https://github.com/RobLoach/raylib-cpp/tree/master/projects/CMake 中的那三个文件(main.cpp、README.md、CMakeLists.txt)
  4. 然后 cd new-game && mkdir build && cd build && cmake .. && make
  5. 运行 ./raylib-cpp-example