-4

我尝试在终端中编译c中的代码,编译器向我抛出我无法理解的消息..

按摩师是:

user@user-virtual-machine:~/Desktop$ gcc -o run execute.cpp
execute.cpp: In function ‘void KillCommand(char*)’:
execute.cpp:389:57: warning: converting to non-pointer type ‘char’ from NULL [-Wconversion-null]
execute.cpp: In function ‘void GetCommand(char*, char**, char*, char*, char*)’:
execute.cpp:477:129: warning: NULL used in arithmetic [-Wpointer-arith]
/tmp/ccg3lDy1.o:(.eh_frame+0x10b): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status
4

1 回答 1

4

如果您正在编译 C++ 代码,请g++使用gcc.

它设置了一些不同的标志,最重要的是它自动链接到 C++ 运行时库。

于 2013-04-19T14:47:17.813 回答