sammycage / plutovg

Tiny 2D vector graphics library in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Link error when build example in Windows

suconbu opened this issue · comments

commented
LINK : fatal error LNK1104: cannot open file 'm.lib' ...

** Build with VSCode using "Visual Studio Community 2019 Release - amd64".

I tried the following changes then no errors occur. (also in Linux)

diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index d5150e4..26ea9c5 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -5,4 +5,4 @@ set(CMAKE_C_STANDARD 99)
 project(smiley C)
 
 add_executable(smiley smiley.c)
-target_link_libraries(smiley plutovg m)
+if(WIN32)
+    target_link_libraries(smiley plutovg)
+else()
+    target_link_libraries(smiley plutovg m)
+endif()