I had a linker error today and this is how I fixed it.

master
brayden 1 周之前
父節點
當前提交
eaad9cb1b9
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. +6
    -0
      Working-with-CMake.md

+ 6
- 0
Working-with-CMake.md

@ -24,6 +24,12 @@ To generate build files in separate directory and build the project, use these c
cmake -B build && cmake --build build
```
If you encounter a linker error with undefined symbols to glfw functions, it may be necessary to add `glfw` to the linking:
```cmake
target_link_libraries(${PROJECT_NAME} glfw raylib)
```
Note that this required an installation of `glfw` in the environment (e.g. through a package manager or CMake).
## Loading raylib inside cmake
If you want someone who builds your project to be able to download and build raylib with it, the [CMakeLists.txt at projects/CMake](https://github.com/raysan5/raylib/blob/master/projects/CMake/CMakeLists.txt)
will help you.

Loading…
取消
儲存