2023-08-02 05:57 AM
Seems I cannot add cpp files to a sample project (NUCLEO-H723ZG HID_Standalone (USB_Host)) because the project is of C nature. How to convert it to C++, so the makefile and mk files are generated taking into account cpp files? I found https://community.st.com/t5/stm32cubeide-mcu/no-debug-information-available-after-quot-convert-to-c-c-adds/m-p/321877#M17426 but seems that the option mentioned new->convert is not present anymore?
2023-08-02 06:18 AM - edited 2023-08-02 06:20 AM
Just look in the Fine Manual. It's there.
(but files generated by Cube remain .c. this is a feature, not a bug)
2023-08-02 06:23 AM
Yes, I found that the option is on the right click menu -> convert to c++, as suggested in here https://community.st.com/t5/stm32cubeide-mcu/undefined-reference-to-main-error-while-convert-c-project-to-cpp/m-p/189548
Now I'm fighting with the hundred error messages,
In file included from /Users/bloom/STM32CubeIDE/workspace_1.13.0/HID_Standalone/Core/Src/main.cpp:21:
../../Core/Inc/main.h:27:1: note: 'extern "C"' linkage started here
It's a very productive environment! :D
2023-08-02 08:26 AM
In the file HID_Standalone/USB_Host/Target/usbh_conf.h for the aforementioned board/sample, there's this missing at the end of the file:
#ifdef __cplusplus
}
#endif
maybe you can add it to the Fine Manual. :D :p
2023-08-02 08:35 AM