mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -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
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user