mba icon indicating copy to clipboard operation
mba copied to clipboard

Run error

Open iuming opened this issue 4 years ago • 5 comments

Hello, when I use your sample program to run, such an error occurred, how can I solve it?

Run_error

iuming avatar Aug 24 '20 06:08 iuming

Looks like you are using an old (pre C++11) compiler.

ddemidov avatar Aug 24 '20 07:08 ddemidov

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.

iuming avatar Aug 24 '20 07:08 iuming

I used MingW to compile and run, and it succeeded. Is it because this program compiles with C++17 standard and will cause errors?

iuming avatar Aug 24 '20 08:08 iuming

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.

ddemidov avatar Aug 24 '20 10:08 ddemidov

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.

Ok, thank you very much for your help, i will try it.

iuming avatar Aug 24 '20 10:08 iuming