Skip to main content
S.Kamath
Associate III
February 14, 2019
Question

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

  • February 14, 2019
  • 1 reply
  • 573 views

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?

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
February 14, 2019

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..