Multiple Definition Error in Static Library Project

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

Multiple Definition Error in Static Library Project

2,076件の閲覧回数
ramazan_kurban3
Contributor III

Hi. I have same function as "void myFunc();" in seperate 2 library as "libA.h" and "libB.h" in "myStaticLibrary" project. I add this "myStaticLibrary.a" to my main project linker library. I define only libA.h in my main code and ı use myFunc() but Compiler expect Multiple Defination error for myFunc(). How can ı solve this problem. 

0 件の賞賛
1 返信

1,819件の閲覧回数
lpcxpresso_supp
NXP Employee
NXP Employee

You must make sure that your build configurations build source files that do not provide two implementations for "myFunc" at the same time, for a given build artifact. You need to identify the two implementations of that particular function and make sure you leave only one.

Greetings,
MCUXpresso IDE Support

0 件の賞賛