autoconf
[Top][All Lists]
Advanced

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

Re: Library Link order, cygwin, AC_TRY_LINK


From: Christopher B Egner
Subject: Re: Library Link order, cygwin, AC_TRY_LINK
Date: Tue, 29 Jun 2004 16:27:36 -0700

I do have one library (bzip2 library) that fails to find an existing library function under MinGW but otherwise I have not encountered any configure problems under Cygwin and MinGW.

Hrmm. I was hoping this would be a well known issue that somehow escaped documentation. :o/

I have not updated my Cygwin environment for quite a while. It may be that there is some new Cygwin linker bug which is causing the problem. Or perhaps, libreadline is dependent on some other library and the linker is handling the error wrong.

I checked into that, hoping that might be it...

address@hidden /tmp$ gcc -o conftest.exe -I/usr/include -I/usr/include -I/usr/include -lreadline rl_test.c /cygdrive/c/DOCUME~1/egner2/LOCALS~1/Temp/ccb1Czwp.o(.text+0x2e):rl_test.c: undefined reference to `_readline'
collect2: ld returned 1 exit status

address@hidden /tmp$ gcc -o conftest.exe -I/usr/include -I/usr/include -I/usr/include rl_test.c -lreadline

address@hidden /tmp
$

As you can see, inverting the source file and the library does the trick.

For the curious, rl_test.c is:

#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>

int
main( int argc, char** argv )
{
        readline( "prompt>" );
        exit( 0 );
}

--EOF--

Thanks, though.  Hopefully someone else has run into this before.

Chris Egner




reply via email to

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