- C++相談室 part116 [転載禁止]©2ch.net
242 :デフォルトの名無しさん[sage]:2015/03/23(月) 06:24:51.10 ID:XTpYB3rU - # vi test.cpp
# cat test.cpp #include <stdio.h> class test{ public : void out(){ printf("test test"); } }; int main(char*args []){ test t; t.out(); getchar(); return 0; } # gcc -o test.exe test.cpp test.cpp:10:5: 警告: ‘int main(char**)’ の第一引数は ‘int’ であるべきです [-Wmain] int main(char*args []){ ^ test.cpp:10:5: 警告: ‘int main(char**)’ は 0 個または 2 個の引数のみとります [-Wmain] /tmp/ccMmfykR.o:(.eh_frame+0x4b): `__gxx_personality_v0' に対する定義されていない参照です collect2: エラー: ld はステータス 1 で終了しました # g++ -o test.exe test.cpp test.cpp:10:5: 警告: ‘int main(char**)’ の第一引数は ‘int’ であるべきです [-Wmain] int main(char*args []){ ^ test.cpp:10:5: 警告: ‘int main(char**)’ は 0 個または 2 個の引数のみとります [-Wmain] 何が原因なのでしょうか??
|