首页 > 其他 > 详细

ld: symbol(s) not found for architecture armv7错误

时间:2014-12-25 16:34:45      阅读:187      评论:0      收藏:0      [点我收藏+]

将两个c函数从cpp文件中分离出来单独放入一个c文件中,报了下面的错:

Undefined symbols for architecture armv7:
  "MyEncrypt(unsigned char*, int, unsigned char*, int*, unsigned char*)", referenced from:
      MainScene::init() in MainScene.o
  "MyDecrypt(unsigned char*, int, unsigned char*, unsigned char*)", referenced from:
      MainScene::init() in MainScene.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)


很是抓狂啊,为什么是Undefined symbols for architecture armv7啊?明明还有arm64的。

最后的错误原因感觉跟armv7有点风马牛不相及,其实是很简单的问题,太少写C代码了,居然把这个也忘记了:

If you are using c function in c++ file. you should use extern "c"{}. In .h file

#ifdef __cplusplusextern "C" 
{
#endif

swrve_currency_given(parameter1, parameter2, parameter3);// a c function

#ifdef __cplusplus
}
#endif


ld: symbol(s) not found for architecture armv7错误

原文:http://my.oschina.net/u/1443646/blog/360422

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!