Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Sharing .c/.h pairs in Multiple Projects(Mainting .c/.h files whilst they are in development across multiple projects)
Sharing .c/.h pairs in Multiple Projects [message #1821844] Fri, 21 February 2020 04:48 Go to next message
Sam Spencer is currently offline Sam SpencerFriend
Messages: 1
Registered: February 2020
Junior Member
Hi,

First post here. I've been using Eclipse previously with SystemWorkbench for STM32 and now the STM32CubeIDE.
I'm working on an embedded project which uses multiple microcontrollers and need to use the same .c and .h files for both (with different configs depending on which micro is being targeted).
I've been using symlinks in windows with the shared files located in a separate folder, however this isn't ideal due to having to setup new symlinks for new projects and iterations.

Ideally I'd like to have a separate folder with all of my different "libraries" (.c and .h) files which I can import into any project, and changes made in any project will update the files, and hance, their usage in other projects.

I've been trying to do this using paths and project preferences, but no luck so far.

Any thoughts?
Re: Sharing .c/.h pairs in Multiple Projects [message #1821937 is a reply to message #1821844] Mon, 24 February 2020 04:00 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
I'm not familiar with STM32CubeIDE.
You may get a better response at their support.
Third party developers sometimes trim the CDT IDE dropping features.

If it's like the standard issue of CDT, you're going to have problems when Eclipse builds the Makefile.
Eclipse built makefiles are limited to one executable.

One way would be to create projects for each "library" and actually create a library.
Then reference the library project from an executable project.
Project --> C/C++ General --> Project References

Another way might be to add source files into project A from project B using soft links.


Frankly, I would write and maintain my own Makefile.


Re: Sharing .c/.h pairs in Multiple Projects [message #1821969 is a reply to message #1821937] Mon, 24 February 2020 19:35 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
One more vote for own Makefile.

I have pretty bad experience of CubeMX and the STM library code. CubeMX is an excellent tool for sorting out the package pin setups, but I would not bet the farm on their code.


--

Tauno Voipio
Previous Topic:Can't import simple libraries
Next Topic:"Launch (project name ) is filtered " ?
Goto Forum:
  


Current Time: Fri Apr 19 14:15:11 GMT 2024

Powered by FUDForum. Page generated in 0.02170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top