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

could not convert from 'String' to 'std::__cxx11::string #5

Open
Bazmundi opened this issue Feb 21, 2021 · 1 comment
Open

could not convert from 'String' to 'std::__cxx11::string #5

Bazmundi opened this issue Feb 21, 2021 · 1 comment

Comments

@Bazmundi
Copy link

I dropped the Int64String code verbatim into the build enviroment for ESP32 under ESPHome.

Getting the following compile error when trying to use the code:

src/main.cpp: In lambda function:
src/main.cpp:250:25: error: could not convert 'int64String(int64_t, uint8_t, bool)(10, 1)' from 'String' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
       return int64String(ESP.getEfuseMac(),10,true);

Any ideas how to fix this please?

@djGrrr
Copy link
Owner

djGrrr commented Feb 21, 2021

@Bazmundi this appears to simply be that the return type of your function is not set correctly. int64String returns an Arduino String object: https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/

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