Multiple Definition Error in Static Library Project

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Multiple Definition Error in Static Library Project

2,399 次查看
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 回复

2,142 次查看
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 项奖励
回复