I had some code that I developed on Ubuntu and now I am trying to compile it on Windows 7 (MS VS 2010).
vector<float> tmp; .... tmp = {3.0,4.5,9.4}; This gives me syntax error
error C2143: syntax error : missing ';' before '{' Is this because Visual studio doesn't support this feature ? or should I be enabling some switch in the properties. I have the "Platform Toolset" property set to "v100."
Thank you.
To check if Visual C++ redistributables are installed, open Add and Remove Programs and look for the Microsoft Visual C++ Redistributable. If installed, you see "Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.22. 27821".
C/C++ configurations# You can view the C/C++ configuration UI by running the command C/C++: Edit Configurations (UI) from the Command Palette (Ctrl+Shift+P). This opens the C/C++ Configurations page. When you make changes here, VS Code writes them to a file called c_cpp_properties.
More precisely, the default path where you'll find the compiler is C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin .
The C++0x features are enabled by default on the Visual Studio 2010 C++ compiler. It takes no extra switches for example to use lambdas, auto, etc ... If you're getting that error it's because in all likelyhood it's not supported.
EDIT
Based on this MSDN article, initializer lists are not one of the 6 supported features in 2010
the Visual C++ compiler in Visual Studio 2010 enables six C++0x core language features: lambda expressions, the auto keyword, rvalue references, static_assert, nullptr and decltype
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With