cx_Oracle on cygwin

Gerhard Häring gh_pythonlist at gmx.de
Wed Feb 6 02:59:08 EST 2002


Le 06/02/02 à 02:55, Andy Todd écrivit:
> [...]
> Now everything is fine until we reach this stage;
> 
> gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.3.9-i686-
> 2.2/cx_Oracle.o -L/Tools/Lib -L/usr/lib/python2.2/config -loci -
> lpython2.2 -o build/lib.cygwin-1.3.9-i686-2.2/cx_Oracle.dll -s
> /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-
> cygwin/bin/ld: cannot find -loci
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
> 
> Reading 'man' for gcc this *seems* to be a problem because the linker is 
> looking for a file called liboci.a which, naturally, doesn't exist under 
> windows. I think I should be linking to oci.dll, but I don't know enough 
> to be sure.

I've little experience with Cygwin, but I have some with mingw32.

You need to create an import library for the oci.dll fle. The import
library will have a name liboci.a. This is a two-step task.

1) Create a .def file for the DLL
2) Create the import library

Assuming the mingw approach also works with Cygwin (which I'm 95 % sure
it does), you can look here: http://www.mingw.org/docs.shtml in the
section "How to create a def file for a dll".

This should work (more options at the URL above):

    echo EXPORTS > oci.def
    nm oci.dll | grep ' T _' | sed 's/.* T _//' >> oci.def
    dlltool --def oci.def --dllname oci.dll --output-lib liboci.a

Be sure to put liboci.a in a place where Python finds it when linking.

Gerhard
-- 
This sig powered by Python!
Außentemperatur in München: 8.2 °C      Wind: 0.3 m/s




More information about the Python-list mailing list