Code sharing between projects

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Code sharing between projects

ソリューションへジャンプ
2,382件の閲覧回数
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!

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
2,236件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
2,236件の閲覧回数
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 件の賞賛
返信
2,236件の閲覧回数
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 件の賞賛
返信
2,237件の閲覧回数
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 件の賞賛
返信