2023-03-10 03:21 AM
I'm having trouble compiling a TouchGFX project in STM32CubeIDE.
As I need to call a C++ function (touchgfx::OSWrappers::signalVSync()) from inside a .c file (app_azure_rtos.c) I created a C++-linker function as described in this thread.
Also as described in aboves thread I'm getting an error when compiling. The Error says
../Middlewares/ST/touchgfx/framework/include/touchgfx/hal/OSWrappers.hpp:23:1: error: unknown type name 'namespace'
23 | namespace touchgfx
So it seems that the C-Compiler tries to compile a .hpp header file.
How can I tell the C-Compiler to exclude a single file from being build? I can exclude a whole directory . But this makes the whole directory (all files included) unavailable for all compilers/languages. I'm on STM32CubeIDE 1.12.0
Solved! Go to Solution.
2023-03-11 02:52 AM
Found the mistake:
I was still including the OsWrappers.hpp inside a C file. This caused the C linkage fault.
2023-03-11 08:18 AM
By the way, in *.cpp files the #ifdef __cplusplus is completely useless and the extern "C" is also not necessary as the function is already declared as such in a header file.