SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32

Using C++ and C files. Header file compilation error

Hi All

I have a project using STM32F407 MCU. I have a main.cpp and several .cpp and .c files. When compiling, I am getting errors related to the header files:

For example:

In file included from C:/tmp/ACC/inc/Controller.h:11:0,
from C:/tmp/ACC/inc/main.h:11,
from ../src/simulatorcontrol.c:4:
C:/tmp/ACC_DE25/inc/AdcChannel.h:39:1: error: unknown type name ‘class’

This file AdcChannel.h has the following:

  1. ifndef ADC_CHANNEL
  2. define ADC_CHANNEL

  1. ifdef __cplusplus

extern “C” {

  1. endif

  1. include “AdcCommon.h”

class AdcChannel


  1. ifdef __cplusplus


  1. endif

  1. endif // ADC_CHANNEL

Any advice how to fix this?



The problem is that your source file is named simulatorcontrol.c ; according to the C extension, this is a C source file, so you should not include (directly or indirectly) any C++ header file, while probably both Controller.h and AdcChannel.h are C++...

Either your source file is a C++ file, so it’s extension should be cpp, or, in main.h, you should only include Controler.h if compiling C++ code, that is protect it by an #ifdef __cplusplus

Hope this helps clarifying things,

Bernard (Ac6)


Newest Forum Posts

  1. SW4STM32 installation on Ubuntu 20.04 LTS by mahnac72, 2022-01-17 09:12
  2. STM32G0B1 support by Nevada, 2022-01-14 18:47
  3. compiling date/time by yang@omniverter.com, 2022-01-13 20:07
  4. compiling date/time by tang, 2022-01-13 10:51
  5. compiling date/time by yang@omniverter.com, 2022-01-12 19:19
  6. STM32429 Discovery board Linux problem by llcheng, 2022-01-10 10:38
  7. STM32F030K6T6 Pa7 Question by jobhunter, 2022-01-07 10:20
  8. System workbench how to configure openocd debug by gxz, 2022-01-03 15:49
  9. Auto generate build/version number by katarcza, 2022-01-01 11:00
  10. Charger firmware by kacio, 2021-12-30 09:04

Last-Modified Blogs