Thread overview
lib readline
Mar 06, 2007
Luís Marques
Mar 06, 2007
Mike Johnson
Mar 06, 2007
tomD
March 06, 2007
Hello,

I want to use readline, and at the moment my codebase only compiles on windows, so I searched for a windows package of readline and found:

http://gnuwin32.sourceforge.net/packages/readline.htm

I am unable to link with it though.
I have tried to use coffimplib, but it tells me that the readline.lib file is not a supported library.

Suggestions, please?

Luís
March 06, 2007
Just a guess, but I imagine they're using gcc on Windows, maybe mingw. You don't want your library and D to use different C runtimes... bad things happen.

Best bet is to probably compile readline yourself...

Luís Marques wrote:
> Hello,
> 
> I want to use readline, and at the moment my codebase only compiles on windows, so I searched for a windows package of readline and found:
> 
> http://gnuwin32.sourceforge.net/packages/readline.htm
> 
> I am unable to link with it though.
> I have tried to use coffimplib, but it tells me that the readline.lib file is not a supported library.
> 
> Suggestions, please?
> 
> Luís
March 06, 2007
Luís Marques Wrote:

> Hello,
> 
> I want to use readline, and at the moment my codebase only compiles on windows, so I searched for a windows package of readline and found:
> 
> http://gnuwin32.sourceforge.net/packages/readline.htm
> 
> I am unable to link with it though.
> I have tried to use coffimplib, but it tells me that the readline.lib
> file is not a supported library.
> 
> Suggestions, please?
> 
> Luís

Try to make a DLL out of the lib, run implib on it and mostly
you are done. Try building libreadline with ./configure --lots-of-switches --enable-shared
This should let you end wih the .dll. Otherwise try something like this:

GCC=gcc -mno-cygwin
cblas.dll: $(LIBCBLAS)
        mkdir -p obj
        (cd obj; ar x ../$(LIBCBLAS); \
        $(GCC) -shared -o ../cblas.dll *.o \
        -Wl,--output-def=../cblas.def \
        -Wl,--export-all-symbols \
        -Wl,--enable-auto-import \
        -Wl,--enable-auto-image-base \
        -Wl,--compat-implib \
        -Wl,--add-stdcall-alias \
        -Wl,--enable-stdcall-fixup \
        )
        rm -rf obj
gsl.dll: $(LIBGSL) cblas.dll
        mkdir -p obj
        (cd obj; ar x ../$(LIBGSL); \
        $(GCC) -shared -o ../gsl.dll *.o ../cblas.dll \
        -Wl,--output-def=../gsl.def \
        -Wl,--export-all-symbols \
        -Wl,--enable-auto-import \
        -Wl,--enable-auto-image-base \
        -Wl,--compat-implib \
        -Wl,--add-stdcall-alias \
        -Wl,--enable-stdcall-fixup \
        )
        rm -rf obj


I did that for gsl-1.9, there was some tweaking required
in the build process, otherwise it worked fine.

Ciao
Tom