【发布时间】:2021-10-16 15:34:21
【问题描述】:
我使用 Peppermint 10 一个基于 ubuntu 的发行版
所以我执行了以下命令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
【问题讨论】:
-
您好,请不要安装 raylib。如果您想快速启动游戏项目,请使用 Cmake 模板:github.com/raysan5/raylib/tree/master/projects/CMake 或 C++:github.com/RobLoach/raylib-cpp/tree/master/projects/CMake。 CMake 将为您下载正确版本的 raylib。在我的第一个项目中,我使用github.com/RobLoach/raylib-cpp/tree/master/projects/CMake 没有任何问题。
-
兄弟,非常感谢
-
但是如何将模板添加到我的电脑?
-
我怎么运行它:(
标签: c++ c cmake ubuntu-16.04 raylib