瀏覽代碼

Fix examples linking with CMake and -DPLATFORM=SDL (#3825)

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.
pull/3839/head
Peter0x44 9 月之前
committed by GitHub
父節點
當前提交
b86f78f6b1
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. +3
    -0
      examples/CMakeLists.txt

+ 3
- 0
examples/CMakeLists.txt 查看文件

@ -131,6 +131,9 @@ foreach (example_source ${example_sources})
add_executable(${example_name} ${example_source})
target_link_libraries(${example_name} raylib)
if (NOT WIN32)
target_link_libraries(${example_name} m)
endif()
string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
string(APPEND resources_dir "resources")

Loading…
取消
儲存