cancel
Showing results for 
Search instead for 
Did you mean: 

Compilation errors with STM32 CubeMX C project with .cpp header file having 'Class' type declaration

S.Kamath
Associate II

I want to include Arduino ADXL345 C++ library (ADXL345.cpp/ADXL345.h) in STM32 CubeMX generated C project.

I'm getting the following compilation errors with CubeMX C project with .cpp header file having 'Class' type declaration in Atollic -

unknown type name 'class' ADXL345.h /STM32_SPI/Inc line 115 C/C++ Problem

How to resolve this?

1 REPLY 1

So you're going to have to keep things separate, and provide interfacing to C API functions, or wrappers around C++ ones.

Define access to HAL functions via extern "C"

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..