1) C: works well (placed in a C-file "main.c"),
2) C++: Fails with Problem/ Errors (placed in a CPP-file: "main.cpp" - Simply the renamed "main.c"):
using ESP-IDS Eclipse Plugin v1.0.0-beta4:
reportes Problem: "Symbol 'clk_speed' could not be resolved"
when I press "Compile" or "Lanch" within the Eclipse-IDE,
the terminal-window reports: "Build-Complete (0 Errors, 3 warning) …. -->the toolchain accepts the nested struct initialisation
but from Eclipse, I get an error-message-box:
"Errors in Workspace"/"Error exist in required Project"
Pressing "Proceed" in this error-message-box- everythin is OK,
- Programm works, and has accepted the nested struct initialisation -
- I2C runs
- a c++ test-class also runs well
Seems, that somehow the Eclipse "syntax-checker"? has switched ist behaviour when renaming the file from "main.c" to "main.cpp".
Any Ideas, how to fix it?
- the Phantom-Errors are disturbing,
- the Eclipse-Problem-list is populated with them.
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- static const i2c_config_t cI2cConfig = {
- .mode = I2C_MODE_MASTER,
- .sda_io_num = 21,
- .scl_io_num = 22,
- .sda_pullup_en = true,
- .scl_pullup_en = true,
- .master = {
- .clk_speed = 100000 /* PROBLEM: Symbol 'clk_speed' could not be resolved when in .cpp file*/
- /* <-> works well when placed .c file */
- /* when simply ignoring the Problem-message - the toolchain produces correct output */
- /* seems a Eclipse configuration Problem */
- }
- };
- void app_main(void)
- {
- ...
- i2c_bus_handle_t lI2cBusHandle = iot_i2c_bus_create(0, & cI2cConfig);
- …