loader warning at MacOS X
Dear All,
When building Iperf 1.7.0 at MacOS X:
# uname -a
Darwin mac-g5b.science.uva.nl 8.0.0b1 Darwin Kernel Version 8.0.0b1: Mon Jun 21 20:09:53 PDT 2004; root:xnu/xnu-634.obj~2/RELEASE_PPC Power Macintosh powerpc
I got during the linking stage the following warning message:
g++ -o ../iperf Client.o Extractor.o Listener.o PerfSocket.o PerfSocket_TCP.o PerfSocket_UDP.o Server.o Settings.o Speaker.o Notify.o Audience.o List.o main.o -L../lib -ldast
ld: warning multiple definitions of symbol _warn
../lib/libdast.a(error.o) definition of _warn in section (__TEXT,__text)
/usr/lib/libSystem.dylib(err.So) definition of _warn
In my opinion the reason for that is that the declaration of the system call in
"lib/util.h":
void warn ( const char *inMessage, const char *inFile, int inLine );
is not consistant with the declaration of that call in "/usr/include/err.h":
void warn(const char *, ...);
This combined with the implementation of that call in "lib/error.c":
void warn( const char *inMessage, const char *inFile, int inLine ) {
fflush( 0 );
#ifdef NDEBUG
fprintf( stderr, "%s failed\n", inMessage );
#else
/* while debugging output file/line number also */
fprintf( stderr, "%s failed (%s:%d)\n", inMessage, inFile, inLine );
#endif
} /* end warn */
probably will lead to that loader warning message.
As an implemenation of the "warn()" call has been given, my solution was to make
its function name unique by adding to "lib/util.h":
#define warn PrivateWarn
before the first usage of "warn()". With this define macro there are no problems
with the compilation and linking of Iperf.
Kind regards,
Hans Blom