在mac os系统下用nvcc编译完成,用g++链接的时候(g++ ...-lcutil_i386…)出现的错误:

在mac os系统下用nvcc编译完成,用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’

你查一下nvcc手册,我记得-arch是不支持i386的