GNOME Bugzilla – Bug 508435
Compile failure due to local round() function
Last modified: 2013-02-01 19:57:06 UTC
A fink user has reported that while compiling dasher-4.6.1 on OS X 10.4 (gcc 4.0.1), the final linking of the dasher binary fails with: /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: multiple definitions of symbol _round /usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../../libpthread.dylib (rndint.o) definition of _round DasherCore/libdashercore.a(AutoSpeedControl.o) definition of _round in section (__TEXT,__text) On OS X, libpthread is a symlink to libSystem (comparable to libc on linux) and round() is declared in math.h. There are several places in dasher where round() compatibility functions are provided (and based on different criteria each time), so maybe this whole mess could be solved everywhere in a more unified fashion. How about a configure test for it (AC_SEARCH_LIBS or AC_CHECK_FUNCS or somesuch) and then use the result of that test to decide whether to implement a compatibilility function?
This should be fixed by http://git.gnome.org/browse/dasher/commit/?id=f31353a3525e3c2d0b94acedbcb21b1ebcb84785 though I may remove the round() compatibility function entirely later: do you know of a system without it? (Even windows seems to have it.)
Amazingly a test compile shows that windows (VS2010) doesn't have round() !