Skip to main content
phgphd
Associate
February 22, 2023
Solved

How can I add files to a STM32CubeIDE project as links?

  • February 22, 2023
  • 2 replies
  • 4294 views

If anyone is familiar with Code Composer IDE, CCS allows me to add files to a project as links. If this is not possible, perhaps you might have suggestions of how to share common code files between projects without replicating the common code.

Best answer by phgphd

So there is a way to work within IDE. Under File select Import, under General select File System, then select Advanced, select "create links", then setup your 'from Directory' and 'Into Folder' fields. One or more files/or folders can be then be linked.

2 replies

Pavel A.
Super User
February 22, 2023

CubeIDE is based on Eclipse, exactly as the CCS. So, linked files and folders work in CubeIDE exactly as in CCS.

phgphd
phgphdAuthor
Associate
February 22, 2023

So CCS provides a menu item to add files as links from within the IDE. That is what I am asking, can I add files as links from within Cube IDE or do I need create the links outside the IDE using Windows?

phgphd
phgphdAuthorBest answer
Associate
February 22, 2023

So there is a way to work within IDE. Under File select Import, under General select File System, then select Advanced, select "create links", then setup your 'from Directory' and 'Into Folder' fields. One or more files/or folders can be then be linked.

RLein.1
Associate III
March 17, 2025

I have gotten this to work, but one of the files I have linked to my project is an include file.  When I try to make the project I get an error saying that the .h file does not exist.  I tried adding a path to the project as seen in the following screen capture, but it appears that the compiler is not taking the file link.  How can this be resolved?

RLein1_0-1742245671159.png

 

RLein.1
Associate III
March 17, 2025

I discovered the solution.  You need to select File System instead of Workspace when creating the path