build failure in src/calculation/test
David Jafferian - Sun Microsystems
david.jafferian at east.sun.com
Tue Feb 8 18:42:03 EST 2005
Hi -
I wasn't able to find this problem in mailing list archives.
=>uname -mrs
SunOS 5.9 sun4u
=>gcc --version
gcc (GCC) 3.4.1
...
=>rm expression_parser.lo
=>make
Making all in .
make[1]: Entering directory `/home/davidja/GnuCash/latest/gnucash/src/calculation'
...
/bin/bash ../../../libtool --mode=link gcc -I/opt/sfw/include -I/usr/sfw/include -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -o test-link test-link.o ../libgncmod-calculation.la -L/usr/sfw/lib -R/usr/sfw/lib -lglib -lpopt -lm -lm
gcc -I/opt/sfw/include -I/usr/sfw/include -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement -o .libs/test-link test-link.o ../.libs/libgncmod-calculation.so -L/usr/sfw/lib -L/usr/local/lib /usr/local/lib/libguile.so /usr/local/lib/libguile-ltdl.so -ldl -lsocket -lnsl /usr/sfw/lib/libglib.so -lpopt -lm -R/usr/local/lib/gnucash -R/usr/local/lib -R/usr/sfw/lib
Undefined first referenced
symbol in file
gnc_numeric_add ../.libs/libgncmod-calculation.so
gnc_numeric_sub ../.libs/libgncmod-calculation.so
ld: fatal: Symbol referencing errors. No output written to .libs/test-link
collect2: ld returned 1 exit status
make[1]: *** [test-link] Error 1
make[1]: Leaving directory `/home/davidja/GnuCash/latest/gnucash/src/calculation/test'
make: *** [all-recursive] Error 1
The fix was simple :
=>cd /home/davidja/GnuCash/latest/gnucash/src/engine
=>diff -c gnc-numeric.h.orig gnc-numeric.h.new
*** gnc-numeric.h.orig Sun Oct 31 20:37:09 2004
--- gnc-numeric.h.new Tue Feb 8 16:19:04 2005
***************
*** 417,423 ****
* Shortcut for common case: gnc_numeric_add(a, b, GNC_DENOM_AUTO,
* GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
*/
! static inline
gnc_numeric gnc_numeric_add_fixed(gnc_numeric a, gnc_numeric b) {
return gnc_numeric_add(a, b, GNC_DENOM_AUTO,
GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
--- 417,423 ----
* Shortcut for common case: gnc_numeric_add(a, b, GNC_DENOM_AUTO,
* GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
*/
! static __inline__
gnc_numeric gnc_numeric_add_fixed(gnc_numeric a, gnc_numeric b) {
return gnc_numeric_add(a, b, GNC_DENOM_AUTO,
GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
***************
*** 427,433 ****
* Shortcut for most common case: gnc_numeric_sub(a, b, GNC_DENOM_AUTO,
* GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
*/
! static inline
gnc_numeric gnc_numeric_sub_fixed(gnc_numeric a, gnc_numeric b) {
return gnc_numeric_sub(a, b, GNC_DENOM_AUTO,
GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
--- 427,433 ----
* Shortcut for most common case: gnc_numeric_sub(a, b, GNC_DENOM_AUTO,
* GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
*/
! static __inline__
gnc_numeric gnc_numeric_sub_fixed(gnc_numeric a, gnc_numeric b) {
return gnc_numeric_sub(a, b, GNC_DENOM_AUTO,
GNC_HOW_DENOM_FIXED | GNC_HOW_RND_NEVER);
Apparently there is a reason why __inline__ is recommended for header
files. Can anyone offer an explanation ?
--
David N. Jafferian
Solaris Kernel and Drivers
Product Technical Support
Sun Microsystems, Inc.
More information about the gnucash-devel
mailing list