GNOME Bugzilla – Bug 755489
Fix linking error for undefined reference to hypot
Last modified: 2015-09-24 08:28:00 UTC
libtool: link: gcc -shared -fPIC -DPIC .libs/libyelp_la-yelp-bookmarks.o .libs/libyelp_la-yelp-debug.o .libs/libyelp_la-yelp-error.o .libs/libyelp_la-yelp-docbook-document.o .libs/libyelp_la-yelp-document.o .libs/libyelp_la-yelp-help-list.o .libs/libyelp_la-yelp-info-document.o .libs/libyelp_la-yelp-info-parser.o .libs/libyelp_la-yelp-magic-decompressor.o .libs/libyelp_la-yelp-mallard-document.o .libs/libyelp_la-yelp-man-document.o .libs/libyelp_la-yelp-man-parser.o .libs/libyelp_la-yelp-marshal.o .libs/libyelp_la-yelp-search-entry.o .libs/libyelp_la-yelp-simple-document.o .libs/libyelp_la-yelp-sqlite-storage.o .libs/libyelp_la-yelp-storage.o .libs/libyelp_la-yelp-transform.o .libs/libyelp_la-yelp-types.o .libs/libyelp_la-yelp-view.o .libs/libyelp_la-yelp-lzma-decompressor.o .libs/libyelp_la-yelp-bz2-decompressor.o -Wl,-rpath -Wl,/build/yelp-3.18.0/libyelp/.libs -Wl,-rpath -Wl,/usr/lib/yelp ./.libs/libyelpcommon.so -L/usr/lib/x86_64-linux-gnu -lbz2 -llzma -lexslt -lxslt -lxml2 /usr/lib/x86_64-linux-gnu/libsqlite3.so -lwebkit2gtk-4.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lsoup-2.4 -lgio-2.0 -lgobject-2.0 -ljavascriptcoregtk-4.0 -lglib-2.0 -pthread -O2 -Wl,-z -Wl,relro -Wl,-z -Wl,defs -Wl,-O1 -Wl,--as-needed -pthread -Wl,-soname -Wl,libyelp.so.0 -o .libs/libyelp.so.0.0.0 .libs/libyelp_la-yelp-view.o: In function `get_screen_dpi': /build/yelp-3.18.0/libyelp/yelp-view.c:2098: undefined reference to `hypot' /build/yelp-3.18.0/libyelp/yelp-view.c:2099: undefined reference to `hypot' collect2: error: ld returned 1 exit status Makefile:608: recipe for target 'libyelp.la' failed
Created attachment 311969 [details] [review] Fix linking error for undefined reference to hypot
Why not use LT_LIB_M in configure?
(In reply to Christian Persch from comment #2) > Why not use LT_LIB_M in configure? That works too and might be better... Attaching updated patch.
Created attachment 312007 [details] [review] LT_LIB_M for hypot
Review of attachment 312007 [details] [review]: Thanks for the patch. I pushed it to master, after modifying the commit message. I guess that the -Wl,--as-needed is what causes this.
Created attachment 312008 [details] [review] LT_LIB_M for hypot [v2]
(In reply to David King from comment #5) > Review of attachment 312007 [details] [review] [review]: > > Thanks for the patch. I pushed it to master, after modifying the commit > message. I guess that the -Wl,--as-needed is what causes this. Argh, you're so quick... I messed up the testing... v2 is actually needed. (Put $(LIBM) under libyelp LIBADD instead of libyelpcommon LIBADD). Please fix.
Pushed a fix as commit 324b465c9c66a8f76921b92e9d25a1230e9564cd.