在UNIX下使用gcc出现undefined reference to `std::cout`

1.gcc是编译c语言的命令,所以使用了cout会编译失败。

2.应该采用g++进行编译,g++对扩展名为.c和.cpp的文件都进行c++编译。

Leave a Reply

Your email address will not be published. Required fields are marked *