mac os: file is not of required architecture

hellolegend 2010-09-15 09:36:35
在mac os系统下学习cuda,用nvcc编译一个源文件(文件本身没有问题,在linux完成过),用g++链接的时候(g++ ...-lcutil_i386…)出现下面的错误:
ld: warning: in example_1.cu.o, file is not of required architecture
ld: warning: in /Developer/GPU Computing/C/lib/libcutil_i386.a, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

然后变成nvcc -arch i386 -m32又出来如下的错误:
nvcc : Value 'i386' is not defined for option 'gpu-architecture'

哪位知道如何解决,请指点一下!
...全文
132 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hellolegend 2010-09-15
  • 打赏
  • 举报
回复
*.a都没有问题,是在这个系统里弄出来的。就是编译自己的.o文件参数不对,然后和-lcutil_i386链接的时候就出现上述的错误。
justkk 2010-09-15
  • 打赏
  • 举报
回复
*.o *.a都需要重新编译吧..
wind_199 2010-09-15
  • 打赏
  • 举报
回复
不会mac

steptodream 2010-09-15
  • 打赏
  • 举报
回复
不会mac
hellolegend 2010-09-15
  • 打赏
  • 举报
回复
编译部分nvcc里面不需要-m32和-arch i386,只需在g++链接部分加入-m32即可。

23,118

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧