Boost logo

Boost :

From: Nokome Bentley (nbentley_at_[hidden])
Date: 2001-11-27 22:59:22


Hi,

I recently discovered Boost.Python and am very impressed by what it appears
to able to do. I have tried building C++ extensions for Python by hand and
appreciate how much easier Boost.Python makes that job. However, I am have
problem getting it to work. I am a novice at compiling and linking issues
and would appreciate any assistance.

I am using Win98SE. Up to now I have used Borland 5.5 to build Python
extensions. But that bawks at compiling Boost.Python. So I got gcc
(version 3.02 as a DJGPP Win32 binary). I tried to use JAM to build
Boost.Python but got:

        jam -ftools/build/allyourbase.jam -sTOOLS="gcc"
        tools/build/allyourbase.jam: line 1608: syntax error at keyword (
        don't know how to make all
        ...found 1 target...
        ...can't find 1 target...

So I compiled all the Booost.Python cpp files that the Boost.Python docs
told me to use into an object file, boostpython.o.

Then I compiled the getting_stated2 example:

        gxx -Ic:/progra~1/boost_1_25_1 -Ic:/progra~1/python21/include -Wall -c
getting_started2.cpp

no problems there, so I tried to link it:

        gxx -shared -o gs.dll getting_started2.o
boostpython.o -Lc:/progra~1/python21/libs -lpython21.lib

but get:

        gcc.exe: unrecognized option `-shared'
        c:/program files/djgpp/bin/ld.exe: cannot find -lpython21.lib
        collect2: ld returned 1 exit status

I have tried various ways of specifying the path for the python21.lib but
get the same response. I am wondering if I am missing something in terms of
how I should be linking to the Python library. Does the Python lib need to
be a certain format? For example, when I used Borland I had to convert the
Python lib using COFF2OMF. When I lists the symbols from the Python library:

        nm --print-armap python21.lib

I get a whole lot of names followed by an error:

        (snip)
        __imp__PyUnicode_Format in python21.dll
        __imp__initxreadlines in python21.dll
        _initxreadlines in python21.dll

        python21.dll:
        BFD: python21.dll: Unrecognized storage class 104 for .idata$2 symbol
`.idata$2'

        BFD: python21.dll: Unrecognized storage class 104 for *UND* symbol
`.idata$4'
        BFD: python21.dll: Unrecognized storage class 104 for *UND* symbol
`.idata$5'
        00000000 i .idata$6
        000420ff a @comp.id
        00000000 I __IMPORT_DESCRIPTOR_python21
                                         U __NULL_IMPORT_DESCRIPTOR
                                         U python21_NULL_THUNK_DATA

        python21.dll:
        000420ff a @comp.id
        00000000 I __NULL_IMPORT_DESCRIPTOR

        python21.dll:
        000420ff a @comp.id
        00000000 I python21_NULL_THUNK_DATA
        c:/progra~1/djgpp/bin/nm.exe: python21.dll: File format not recognized
        c:/progra~1/djgpp/bin/nm.exe: python21.dll: File format not recognized
        c:/progra~1/djgpp/bin/nm.exe: python21.dll: File format not recognized
        (snip)
        c:/progra~1/djgpp/bin/nm.exe: python21.dll: File format not recognized
        Exiting due to signal SIGSEGV
        Page fault at eip=0003e7db, error=0004
        eax=2e31326e ebx=00aceb3c ecx=00acfb2c edx=2e313272 esi=00acfb2c
edi=0000000b
        ebp=00a88ec0 esp=00a88eb4 program=C:\PROGRA~1\DJGPP\BIN\NM.EXE
        cs: sel=00a7 base=844e5000 limit=feda1fff
        ds: sel=00af base=844e5000 limit=feda1fff
        es: sel=00af base=844e5000 limit=feda1fff
        fs: sel=0087 base=0000b150 limit=0000ffff
        gs: sel=00bf base=00000000 limit=0010ffff
        ss: sel=00af base=844e5000 limit=feda1fff
        App stack: [00a89000..00a09000] Exceptn stack: [000555e4..000536a4]

        Call frame traceback EIPs:
                0x0003e7db
                0x0003786b
                0x0000583d
                0x00002736
                0x00002800
                0x0000262a
                0x0003df52

Thanks,

Nokome Bentley

Trophia Ltd www.trophia.com
PO Box 60 +64 03 319 6850
Kaikoura
New Zealand


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk