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,具体方法如下:
Undefined symbols for architecture x86_64:的一种解决办法_第1张图片
加上以后,一切正常。

你可能感兴趣的:(Bug问题解决方法)