Linux: App Link Error with Shared Library - Varadic Macro Issue
Greetings all!
I seem have run into a rather sticky issue here, and I'm not finding the answers I'm looking for. I'm hoping someone here has the answer to my woes.
I'm building an embedded linux shared library. I've done this many times before. Difference this time is that we are trying to standardize on some debug macro's in the code. In a header file, I have:
#define LIB_ERR(fmtStr,args...) { printf("ERROR: "); (void) printf(fmtStr , ##args );}
I compile this just fine as a shared library, no errors. When I then go to link my application to this, I get:
/home/Proj/Install/usr/local/lib/brd/libBoard.so: undefined reference to `LIB_ERR'
I include <stdio.h> and <stdarg.h> in the header file to find the printf and varadic info.
Compiler is PPC7xx, version 3.3.1 from Montavista, so it "should" be able to support this setup.
We have a different project, using ARM (4.2.x) in a similar setup and there's no issues.
I've read the GNU specs on varadic macro's, tried different spacing in the definition. Removed the first printf (there is a different macro with the 2 printf's that I don't seem to have a problem with, it's only invoked once though.
Using Eclipse, when I roll-over the Macro, it will expand correctly.
Any insight would be greatly appreciated!
Thanks in Advance for your comments!
Steve
|