学习C++中

使用以下命令编译链接c++文件时报错

gcc test.cpp -o test

错误:

undefined reference to `std::cout'

......

网友说用g++,但是发现没装;

最后通过以下方式解决

gcc test.cpp -o test -lstdc++

在下面的文章找到答案

http://blog.163.com/ziber_fiver/blog/static/20433500120122157938325/

“对于.cpp文件,编译可以用gcc/g++,链接可以用g++或gcc -lstdc++”


/* the end */


相关文章:

  • 2021-11-23
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-13
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2022-02-07
  • 2021-12-15
  • 2021-10-09
相关资源
相似解决方案