GCC 7 cannot compile example files (C++20 features needed) #1069
-
Hello, I wrote so few C++ in my life... I am a beginner here and I would like to get a "from scratch" compilation procedure for this project. Here is my procedure (Linux Mint 19.3), but the compilation crashes : sudo apt install gcc
# Mint 19.3 embeds gcc-7, which is fully C++ 17 compatible, in theory.
# tried the same with gcc-10, but still not working. I may miss some library.
mkdir web-server
cd web-server
git clone https://github.com/uNetworking/uWebSockets
git submodule init
git submodule update
make This results in this log, full of errors :
Sorry for this, this is I am sure a really noob question. Everyone has to start one day. (btw I am an experienced web developer, just a noob in building c++ programming infrastructure). |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
Well, only the compilation of the Echo application crash : I got a working HelloWorld and HelloWorldThreaded apps (and Update...), so I suppose it works well, only the "echo" demo apps miss something. |
Beta Was this translation helpful? Give feedback.
-
Hello, I think the examples require C++20 but the library itself does not. So you probably need GCC9 or Clang10. You can always write the examples in C++17 but then they look less "declarative". |
Beta Was this translation helpful? Give feedback.
-
I tried with GCC10, which fully supports C++20. Only the "ECHO" examples does not work, so I do not matter. The other examples work well, and, YES!, I developed my first c++ web server in 1 hour. EDIT : Confusion : GCC is the C compiler. I need G++, the C++ compiler, version 9 or better. Ok : I try it ! |
Beta Was this translation helpful? Give feedback.
-
Ok : Just installed G++-10 (https://askubuntu.com/questions/1192955/how-to-install-g-10-on-ubuntu-18-04) and all examples work well ! Thanks a lot. |
Beta Was this translation helpful? Give feedback.
-
Here is an "hello world" application example, with all the instructions to make it run from Debian / Ubuntu systems. I will check it on a newly installed debian / ubuntu / mint distro, this could help noobs like me to know how to use it starting from nothing : |
Beta Was this translation helpful? Give feedback.
-
Alright. I try to stay as far away from building instructions as possible but I guess I could cover the need for C++20 a bit better. |
Beta Was this translation helpful? Give feedback.
Hello, I think the examples require C++20 but the library itself does not. So you probably need GCC9 or Clang10. You can always write the examples in C++17 but then they look less "declarative".