Skip to content

Commit

Permalink
Fix examples linking with CMake and -DPLATFORM=SDL
Browse files Browse the repository at this point in the history
Currently, every example fails linking likeso:

[  3%] Linking C executable audio_mixed_processor
/usr/bin/ld: ../raylib/libraylib.a(raudio.c.o): undefined reference to symbol 'exp@@GLIBC_2.29'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Apparently, linking libm explicitly is the solution.
  • Loading branch information
Peter0x44 committed Feb 25, 2024
1 parent 2a774a8 commit 4eb4a35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ foreach (example_source ${example_sources})
# Setup the example
add_executable(${example_name} ${example_source})

target_link_libraries(${example_name} raylib)
target_link_libraries(${example_name} raylib m)

string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
string(APPEND resources_dir "resources")
Expand Down

0 comments on commit 4eb4a35

Please sign in to comment.