automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with AC_LINK_IFELSE and library order


From: Francesco Montorsi
Subject: Problem with AC_LINK_IFELSE and library order
Date: Fri, 21 Oct 2005 23:44:26 +0200
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Hi,
    I have found that my check

AC_LINK_IFELSE([
                AC_LANG_PROGRAM([#include <wx/url.h>],
                                [wxURL u(wxT("http://www.google.it";));])
                            ],
                            [WXURL_PRESENCE=1], [WXURL_PRESENCE=0])

*always* fails because the G++ is called in this way:

g++ -o conftest -g -O0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.7 -I/usr/local/include/wx-2.7 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 /usr/local/lib/libhttpengine.a -L/usr/local/lib -pthread -L/usr/X11R6/lib64 /usr/local/lib/libwx_gtk2ud_xrc-2.7.a /usr/local/lib/libwx_gtk2ud_qa-2.7.a /usr/local/lib/libwx_gtk2ud_html-2.7.a /usr/local/lib/libwx_gtk2ud_adv-2.7.a /usr/local/lib/libwx_gtk2ud_core-2.7.a /usr/local/lib/libwx_baseud_xml-2.7.a /usr/local/lib/libwx_baseud_net-2.7.a /usr/local/lib/libwx_baseud-2.7.a -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lpng -ljpeg -ltiff -lexpat -lwxregexud-2.7 -lz -ldl -lm conftest.cc

(this gives various linking errors) instead of:

g++ -o conftest conftest.cc -g -O0 -I/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.7 -I/usr/local/include/wx-2.7 -D__WXDEBUG__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D_LARGEFILE_SOURCE=1 /usr/local/lib/libhttpengine.a -L/usr/local/lib -pthread -L/usr/X11R6/lib64 /usr/local/lib/libwx_gtk2ud_xrc-2.7.a /usr/local/lib/libwx_gtk2ud_qa-2.7.a /usr/local/lib/libwx_gtk2ud_html-2.7.a /usr/local/lib/libwx_gtk2ud_adv-2.7.a /usr/local/lib/libwx_gtk2ud_core-2.7.a /usr/local/lib/libwx_baseud_xml-2.7.a /usr/local/lib/libwx_baseud_net-2.7.a /usr/local/lib/libwx_baseud-2.7.a -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lXinerama -lXxf86vm -lpng -ljpeg -ltiff -lexpat -lwxregexud-2.7 -lz -ldl -lm

(which links fine).
As you can see the second form differs only for the position of the "conftest.cc" string which is placed at the end of the command in the first case and is placed just after the "-o" option in the second case.
This is because the linker order is important...

So, how can I specify to AC_LINK_IFELSE (or to some other macro) to put "conftest.cc" *before* other libraries (which I specified through the LDFLAGS) ?


Thanks indeed,
Francesco Montorsi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]