1. 程式人生 > >Undefined symbols for architecture x86_64:的一種解決辦法

Undefined symbols for architecture x86_64:的一種解決辦法

Undefined symbols for architecture x86_64:

  "_iconv_open", referenced from:

      _main in main.o

  "_iconv", referenced from:

      _main in main.o

  "_iconv_close", referenced from:

      _main in main.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

後來發現xcode就算使用系統自帶的標頭檔案也需要匯入lib(sqlite和iconv,Mac都自帶),也就是說,單單包含標頭檔案是不夠的,還需要加入lib或Framework,具體方法如下: xcode <wbr>4 <wbr>匯入Lib,Framework的方法,和Undefined <wbr>symbols <wbr>for <wbr>architecture <wbr>x86_64:的一種解決辦法
加上以後,一切正常。