Reputation: 559
I have a bunch of macros defined in a library for example called MY_LIB.so
I built and compiled it successfully. Example:
#define DOSOMETHING() function()
#define ANOTHER() function2()
When I use it in another project, I linked it in my Makefile using -lMY_LIB
and I am getting an undefined reference error to function(). I click on it and it brings me to DOSOMETHING()
macro. How do I get around with linker errors from macros?
Upvotes: 0
Views: 623
Reputation: 24846
Macro
is nothing more than just a copy of it content to code. The linker
sais that function
is not implemented. So just provide an implentation
Upvotes: 3