Closed renkun-ken closed 8 years ago
VSCode: 1.5.2 OS: Ubuntu 16.04.1 Extension: 0.2.1
- same code
could you please show me your config for C/C++ Clang?
It's mine:
// Compiler options for C (e.g. ['-std=c99'])
"clang.cflags": ["-std=c99"],
// Compiler options for C++ (e.g. ['-std=c++11'])
"clang.cxxflags": ["-std=c++11"],
check if you set -std=c++11 for your clang.cxxflags in "user settings" or "workspace settings"
Thanks! With "clang.cxxflags": ["-std=c++11"]
, it works for me now.
Or you can just type: g++ main.cpp -Wall -std=c++0x -o main
Then: ./main
to run the program.
VSCode: 1.5.2 OS: Ubuntu 16.04.1 Extension: 0.2.1
I'm writing C++ 11 code and use lambda in my code. The following code is a simple example:
The code compiles perfectly with
gcc
andclang
but in VSCode it produces the following warnings and errors:Below is a screenshot of this: