---
title: "C++ Project Setup using STM32 Microcontrollers"
url: https://daily.dev/posts/c-project-setup-using-stm32-microcontrollers-pntcsltw1
source_url: https://www.beningo.com/c-project-setup-using-stm32-microcontrollers
type: article
source: "Beningo Embedded Group"
published: 2026-05-31T07:47:59.787Z
updated: 2026-06-04T02:16:54.531Z
tags: ["c++", "embedded", "stm32"]
reading_time: 7
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# C++ Project Setup using STM32 Microcontrollers

**[Beningo Embedded Group](https://daily.dev/sources/beningo)** · 7 min read · 0 upvotes · 0 comments

## Summary

A step-by-step guide to setting up a C++ project on STM32 microcontrollers using STM32CubeIDE. Since ST Microelectronics provides only C libraries, the approach involves creating a standard STM32 project, renaming main.c to main.cpp, and verifying that the g++ compiler is invoked for C++ files while C files continue to use gcc. A simple counter struct is used to demonstrate that C++ classes and constructors work correctly alongside the existing C HAL libraries, with debugging in STM32CubeIDE confirming correct execution on hardware.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.beningo.com/c-project-setup-using-stm32-microcontrollers>

---

Tags: [#c++](https://daily.dev/tags/c++), [#embedded](https://daily.dev/tags/embedded), [#stm32](https://daily.dev/tags/stm32)

[View this post on daily.dev](https://daily.dev/posts/c-project-setup-using-stm32-microcontrollers-pntcsltw1)
