Code sharing between projects

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Code sharing between projects

Jump to solution
756 Views
ky3orr
Contributor II

Hello,

 

I am writing a code which parts will be reused in other projects.

The question is: what is a good practice for code sharing (like libraries -> c+h files)?

I develop now a library which I'd like to include in other project. If new stable version is available I need to recompile other project to see the changes.

Shall I use some separate folder and just change a paths in #includes, or there is some other way?

 

thanks for your comments!

Labels (1)
Tags (2)
0 Kudos
1 Solution
613 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you can use link source file to share file for several project, see attached video
Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
613 Views
ky3orr
Contributor II

Hello,

what is the proper way of including such files into project code?

I've tried #include "source_folder/header_file.h" but KDS says: Unresolved inclusion + No such file or directory.

If I try only #include "header_file.h" I can access it when use Open Declaration but during building KDS says: No such file or directory.

Best regards.   

0 Kudos
613 Views
BlackNight
NXP Employee
NXP Employee

Make sure your folders with the header files are listed in the Includes settings of the project:

pastedImage_0.png

If using C++, make sure you add them as well under the C++ compiler.

You can copy/paste items in Eclipse, see Adding Multiple Include Paths to Build Settings in Eclipse | MCU on Eclipse

I hope this helps,

Erich

0 Kudos
614 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you can use link source file to share file for several project, see attached video
Have a great day,
Zhang Jun

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos