我正在嘗試編譯mac os x的jni庫。如果有問題,我的系統正在運行Mountain Lion。我在xcode中創建了一個jni項目,並將源文件複製到項目中。它編譯良好,但有鏈接錯誤。 以下是錯誤:Mac OS X上的JNI鏈接時出現未定義的符號錯誤
Undefined symbols for architecture x86_64:
"_init_queue", referenced from:
_floodfill in floodfill.o
"_jumpPointSearch", referenced from:
_Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative in main.o
(maybe you meant: _Java_com_clashtune_pathfind_Pathfinder_jumpPointSearchNative)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我做了什麼錯?它有四個源文件main.c
,floodfill.c
,jumppointsearch.c
和queue.c
。我不明白他們做什麼,因爲我不是C程序員。我只是將它們編譯給this forum的朋友。
編輯:
這是項目屬性頁 '構建階段' 這個項目。
謝謝。
@Dayalrai我剛纔用的IDE。我不知道命令是什麼。 –
@Dayalrai我不明白你的意思。我已經將JavaVM.framework添加到框架列表中,並將includes文件夾設置爲JDK附帶的文件夾。 –
@Dayalrai我添加了「Build Phases」屬性頁面的屏幕截圖。 –