[Seek Help] gcc连helloworld都编译不了 Resolved
Tofloor
poster avatar
喵呢酱
deepin
2022-04-29 19:16
Author

之前发帖说无法用gcc编译

我后来试了试。我甚至连helloworld都编译不出

之前的贴

#include 

int main()
{
  std::cout << "hello world" ;
  return 0 ;
}

截图_deepin-terminal_20220429111555.png

Reply Favorite View the author
All Replies
liwl
deepin
2022-04-29 19:20
#1

我把你代码粘贴了一下,编译正常

image.png

Reply View the author
喵呢酱
deepin
2022-04-29 19:29
#2
liwl

我把你代码粘贴了一下,编译正常

image.png

对啊,所以我gcc有问题,不知道怎么解决😭

Reply View the author
black_white_bear
deepin
2022-04-29 19:41
#3
喵呢酱

对啊,所以我gcc有问题,不知道怎么解决😭

据称,大部分的程序问题,都可以通过重装解决;而剩下的问题,是重装引发的

Reply View the author
SamLukeYes
deepin
2022-04-29 19:42
#4
喵呢酱

对啊,所以我gcc有问题,不知道怎么解决😭

所以你编译 cpp 文件为啥不用 g++confused

Reply View the author
左心房的痛
deepin
2022-04-29 19:47
#5

用g++直接就可以,用gcc倒是会提示和楼主一样的

Reply View the author
impressionyang
deepin
2022-04-29 19:58
#6

4楼正解

Reply View the author
wangxinyu
deepin
2022-04-29 20:28
#7

g++飞起

Reply View the author
charm
deepin
2022-04-29 20:33
#8

gcc编译c,g++编译c++或c

Reply View the author
喵呢酱
deepin
2022-04-29 20:47
#9
charm

gcc编译c,g++编译c++或c

了解了

Reply View the author
zerofancy
deepin
2022-04-29 21:57
#10

gcc要编译C++需要加参数

gcc -lc++ main.cpp

Reply View the author
zccrs
deepin
2022-04-29 22:26
#11

写c++还是建议直接上cmake

Reply View the author