I do not know why there is no direct answer to the problem. When you want to compile a program in C ++. It is best to use clang ++, for example, the following works for me:
clang++ -Wall -std=c++11 test.cc -o test
if it compiled correctly, it will create the test executable, you can run the file with ./test .
Or you can just use clang++ test.cc to compile the program, it produces a default executable file called a.out . Use ./a.out to run the file.
The whole process is a lot like g ++, if you are familiar with g ++. See this post to check which warnings are included in the -Wall parameter. This page shows a list of diagnostic flags supported by clang.
jdhao Jun 14 '17 at 2:37 on 2017-06-14 02:37
source share