Multiple Definition Error in Static Library Project

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

Multiple Definition Error in Static Library Project

2,072 Views
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 Kudos
1 Reply

1,815 Views
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 Kudos