Skip to content

undefined reference issue while building "file" sample with uvwasi #2189

Answered by wenyongh
IceCY asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, please add ${UV_A_LIBS} to the link list of iwasm:

diff --git a/samples/file/src/CMakeLists.txt b/samples/file/src/CMakeLists.txt
index 2bc3bec6..96de1a9b 100644
--- a/samples/file/src/CMakeLists.txt
+++ b/samples/file/src/CMakeLists.txt
@@ -85,7 +85,7 @@ check_pie_supported()
 set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON)

 if (APPLE)
-  target_link_libraries (iwasm vmlib -lm -ldl -lpthread)
+  target_link_libraries (iwasm vmlib ${UV_A_LIBS} -lm -ldl -lpthread)
 else ()
-  target_link_libraries (iwasm vmlib -lm -ldl -lpthread -lrt)
+  target_link_libraries (iwasm vmlib ${UV_A_LIBS} -lm -ldl -lpthread -lrt)
 endif ()

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by IceCY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants