I wanna compile a C++ program in Arch Linux, but there's no "g++" package as there is in Ubuntu repositories for example.
Using -x too won't work. like this:
gcc -x c++ -o myprog myprog.cpp
gcc is both a C and C++ compiler.
It will look at the file's extension and process accordingly.
g++ is only a wrapper that calls gcc
g++ is installed with the gcc package in Arch
gcc file.C # uppercase .C (or .cpp) will process as C++
gcc file.c # lowercase .c will process as C
gcc -x c++ -o myprog -lstdc++ myprog.cpp
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4 years ago
2 years ago