Open italocjs opened 4 weeks ago
While all ESP32 code works file, when i try to run the same code on native and call a function that returns an std::string, it with following error:
/usr/bin/ld ...
I'm sorry, your issue report contains too many things which aren't controlled by or related to ESP-IDF, the major two being the PlatformIO build system (especially the part about building the host application) and the host toolchain. As you see, the build for the ESP works fine, and that's the only part of your project which depends on ESP-IDF...
Without knowing more about how platform = native
works in PlatformIO I'm afraid it's hard for ESP-IDF developers to help you. I would recommend seeking help on PlatformIO forum, instead.
(In case it helps, recent ESP-IDF versions contain a similar feature for building applications for host, and use newer C++ standard by default as well.)
Usually undefined reference means that you're not building that file and it is not available for the linker. Maybe you can add an #error
to that file just to confirm it is being at least build for native compilation.
Answers checklist.
General issue report
I am running espidf 4.4.7 (latest compatible with platformio) and c++17. While all ESP32 code works file, when i try to run the same code on native and call a function that returns an std::string, it with following error:
I have tried everything i could find, but nothing seems to work, i think it may be related to the "abi:cxx11" the same code build perfectly fine on esp32dev though. Both are supposed to be using c++ 17
Code is very simple (hal_err_t is an abstraction of esp_err_t, so i can also use it in native)
halTools.h
halTools.cpp
pio.ini