Hello,
I'm using Linux and gcc.
I've created a static library, say libx.a, containing the following
file,
/* errorlog.c begins */
...
extern int debug;
...
/* errorlog.c ends */
And there is some other file, say afile.c, that has nothing to do with
the 'debug' variable.
When I 'gcc afile.c libx.a', it does compile and works fine.
But now I turn the library into a shared library, say libx.so.1.0,
and when I 'gcc afile.c libx.so.1.0', the linker complains,
libx.so.1.0: undefined reference to `debug'
collect2: ld returned 1 exit status
How do I solve this?
Thanks.