当前位置: 技术问答>linux和unix
gcc编译链接的时候出错,不能生成可执行文件。
来源: 互联网 发布时间:2015-08-30
本文导语: make -f Makefile /usr/local/bin/gcc -o aes aes.o Undefined first referenced symbol in file __gxx_personality_v0 aes.o main ...
make -f Makefile
/usr/local/bin/gcc -o aes aes.o
Undefined first referenced
symbol in file
__gxx_personality_v0 aes.o
main /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/
3.2/crt1.o
ld: fatal: Symbol referencing errors. No output written to aes
collect2: ld returned 1 exit status
make: *** [aes] Error 1
该如何解决呢?
/usr/local/bin/gcc -o aes aes.o
Undefined first referenced
symbol in file
__gxx_personality_v0 aes.o
main /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/
3.2/crt1.o
ld: fatal: Symbol referencing errors. No output written to aes
collect2: ld returned 1 exit status
make: *** [aes] Error 1
该如何解决呢?
|
o ?? 感觉好像没有main函数呢
|
把你的Makefile贴出来看看吧。
|
你在生成aes.o的时候没有对源程序中的函数用extern "C"吧
|
GCC编译c代码好像要求文件是以.C后缀,否则会出错,我以前碰到过
试试?
试试?