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

complie warning in c++ project #27

Closed
robin2014 opened this issue Mar 25, 2022 · 1 comment
Closed

complie warning in c++ project #27

robin2014 opened this issue Mar 25, 2022 · 1 comment

Comments

@robin2014
Copy link

robin2014 commented Mar 25, 2022

I use the static library in my c++ project,but it always warning when complie:
warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
.value = "JEi2K66Z7Y",
what can i do to avoid this warning?

@GlitchedPolygons
Copy link
Owner

I use the static library in my c++ project,but it always warning when complie: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings] .value = "JEi2K66Z7Y", what can i do to avoid this warning?

You can either ignore the warning (it should still work, even if assigning string literals to char* in C++ is Not Nice), ooor you can also do a const_cast<char*>("JEi2K66Z7Y") instead of directly assigning the string literal :)

Let me know if this helps. I'll close this for the time being 👍

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