我正在嘗試使用「swig」將已寫入的C++代碼包裝到Objective-C中。將C++包裝到Objective-C中進行本機iOS開發
這是我試圖按照解決辦法:link
基本上我以包裝成Objective-C的正在使用痛飲的修改版本。但是在安裝步驟中,我收到錯誤消息:
clang: warning: argument unused during compilation: '-ansi'
Undefined symbols for architecture x86_64: "_swig_objectivec", referenced from:
modules in swigmain.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [eswig] Error 1
make[1]: *** [all] Error 2
make: *** [source] Error 2
調查該錯誤消息後,我發現什麼,「模塊/ obj.o」文件尚未在編譯時痛飲創建。
然後我修改了我的「Makefile.in」爲obj.cxx添加了必要的行,現在swig創建'Modules/obj.o'文件,但是這次我得到錯誤消息:
make[2]: *** No rule to make target `Modules/obj.cxx', needed by
`Modules/obj.o'. Stop.
make[1]: *** [all] Error 2
make: *** [source] Error 2
任何幫助將不勝感激。
編輯
爲了得到我上面列出的錯誤信息作出在給定的項目鏈接某些文件的變化。所以也許我跟着的第一步是錯誤的,所以這是我在開始時得到的錯誤信息(順便說一句,即使我配置'automake'和'autoconf',我仍然得到給定的錯誤信息);
configure.ac:15: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:33: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:35: error: possibly undefined macro: AC_COMPILE_WARNINGS
configure.ac:48: error: possibly undefined macro: AC_DEFINE
configure.ac:86: error: possibly undefined macro: AC_MSG_FAILURE
configure.ac:3041: error: possibly undefined macro: AC_DEFINE_DIR
錯誤表明您缺少一些庫 – Marco