cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour when setting compiler variables - include paths - Bug report

DocAlex
Associate III

Hello

I am using STM32CubeIDE
Version: 1.19.0
Build: 25607_20250703_0907 (UTC)
OS: Windows 10, v.10.0, x86_64 / win32
Java vendor: Eclipse Adoptium
Java runtime version: 21.0.3+9-LTS
Java version: 21.0.3

 

When I include libraries into my stm32 project I drag and drop a folder (from the windows explorer) int the project predefined folder "Drivers". In a second step I need to set the paths for the C-compiler, C++ compiler and linker seperately. 

 

To do so I open the procect preferences and add a path for the C compiler: In this case The project name is TST_CCS811. and the folder to add is DebugPrintf. I click ok. - path for this folder set. 

2025-08-05 16_07_24-workspace - TST_CCS811_Core_Src_mainCPP.cpp - STM32CubeIDE.png

2025-08-05 16_07_55-Properties for TST_CCS811.png

 

I continue to do so for the C++ compiler and the linker. The path is always the same - it works - paths set. 

2025-08-05 16_09_03-Properties for TST_CCS811.png

 

Now I want to add the next folder in this case GPIO_CPP. 

To do so I click on the C compiler again but now - very strange - another project appears in this case TST_BME280 and not the TST_CCS811 which was selected before. 

 

2025-08-05 16_09_20-Properties for TST_CCS811.png

 

This is very annoying: If you do not recognize this strange behaviour you will add a wrong path (of another project) to jour compilers. It can take very long to find this error - trust me!

Regards

 

Alexander

 

3 REPLIES 3
Pavel A.
Super User

Have you renamed or cloned any of the projects?

TL;DR the Eclipse "virtual filesystem" is cool - but can become deceitful. Prefer ${ProjDirPath} instead of ${workspace_loc:...} constructs.

Hi,

 

If I shall use   ${ProjDirPath} instead, how do I enter this in the IDE? usually I click on the "workspace" button.

 

Regards

 

Alexander

These Eclipse macros can be entered almost in any place where you specify project settings: in C/C++ include directories, other file paths etc.  Also you can define your own variables, in Properties-> C/C++ Build -> Build variables.

Unfortunately the Eclipse version on which CubeIDE is based does not allow to specify project-related paths in include dirs dialog, only "workspace path" or filesystem. It offers to create project-relative paths in other contexts.

I just edit these paths in settings manually. It is annoying but works for me.