Topic
[V23 ] g++ not working
Tofloor
poster avatar
Loonhy
deepin
2022-12-10 04:33
Author

I just installed Deepin 23 and write a simple c++ program:

#include 

int main()  {
    std::cout << "Hello Deepin" << std::endl;
}

and I complie it with command

g++ -o test test.cpp

Yet the compiler gives me

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crt1.o: in function _start': (.text+0x17): undefined reference to main'
collect2: error: ld returned 1 exit status

What's going wrong here?

Reply Favorite View the author
All Replies
Loonhy
deepin
2022-12-13 08:29
#1

NVM. I didn't save the file.

Reply View the author
seoo
deepin
2022-12-17 17:13
#2
The user is banned, and the comment is hidden.
lo******58@gmail.com
deepin
2022-12-26 02:03
#3
The user is banned, and the comment is hidden.
Use Markdown Editor
Loading