mba
mba copied to clipboard
Run error
Hello, when I use your sample program to run, such an error occurred, how can I solve it?
Looks like you are using an old (pre C++11) compiler.
Looks like you are using an old (pre C++11) compiler.
Thank you, but I am using visual studio 19 community edition, it seems to support the C++17 standard.
I used MingW to compile and run, and it succeeded. Is it because this program compiles with C++17 standard and will cause errors?
I don't have access to Windows/Visual Studio compiler in order to try this, but you should be able to rephrase the problematic line so that your compiler would not complain anymore. Line 5 in your screenshot fills the vector with 6 points using the initializer_list
constructor. You can rewrite it into an explicit loop and push_back()
the points into the vector one by one.
I don't have access to Windows/Visual Studio compiler in order to try this, but you should be able to rephrase the problematic line so that your compiler would not complain anymore. Line 5 in your screenshot fills the vector with 6 points using the
initializer_list
constructor. You can rewrite it into an explicit loop andpush_back()
the points into the vector one by one.
Ok, thank you very much for your help, i will try it.