gcc和g++编译器 清疚 2022-06-15 08:13 239阅读 0赞 > .c文件,gcc当做c语言处理 > .cpp文件,gcc和g++当做c++处理 > .c文件和.cpp文件编译时,都是使用的gcc编译器 > .cpp使用gcc链接,需要加入-lstdc++选项 **举例** #include <iostream> using namespace std; int main() { cout << "hello furong." << endl; return 0; } # gcc *.cpp -c # g++ *.o # ./a.out hello furong. # gcc *.cpp -lstdc++ # ./a.out hello furong. **extern “C”**解释 [http://blog.csdn.net/zhangxuechao\_/article/details/72792680][http_blog.csdn.net_zhangxuechao_article_details_72792680] [http_blog.csdn.net_zhangxuechao_article_details_72792680]: http://blog.csdn.net/zhangxuechao_/article/details/72792680
还没有评论,来说两句吧...