mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-01 03:39:18 -05:00
I had a linker error today and this is how I fixed it.
@ -24,6 +24,12 @@ To generate build files in separate directory and build the project, use these c
|
|||||||
cmake -B build && cmake --build build
|
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
|
## 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)
|
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.
|
will help you.
|
||||||
|
|||||||
Reference in New Issue
Block a user