Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run error #11

Open
iuming opened this issue Aug 24, 2020 · 5 comments
Open

Run error #11

iuming opened this issue Aug 24, 2020 · 5 comments

Comments

@iuming
Copy link

iuming commented Aug 24, 2020

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

Run_error

@ddemidov
Copy link
Owner

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

@iuming
Copy link
Author

iuming commented Aug 24, 2020

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
Copy link
Author

iuming commented Aug 24, 2020

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

@ddemidov
Copy link
Owner

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.

@iuming
Copy link
Author

iuming commented Aug 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants