[Stackless] SIP wrapper compilation problems under stackless

Carlos Eduardo de Paula cedepaula at yahoo.com.br
Wed Jan 3 17:28:50 CET 2007


I currently using Stackless Python(www.stackless.com in a small application
i´m developing integrated with Qt and PyQT,  I got some problems trying to compile SIP, the C library wrapper used by PyQt.

When compiling SIP with Microsoft Visual C++ 2003 .NET I got the
following error:

cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -W0 -DUNICODE -DWIN32
-DQT_LAR GEFILE_SUPPORT -DSIP_STATIC_MODULE -I. -Ic:\python25\include -Fo
@C:\DOCUME~1\cpaula\LOCALS~1\Temp\nmB41.tmp
siplib.c
.\siplib.c(6570) : error C2078: too many initializers
qtlib.c
threads.c
objmap.c
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\c l.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\n make.EXE"' : return code '0x2'
Stop.

C:\src\sip-snapshot-20061228>


--------------------------------------------

Then, searching in the sources I found that the include\object.c found in
stackless python is different and was causing the problems.

Looking in the siplib.c sources, I found around the error a way to compile
it and everything worked fine.

I´m sending the changes I made, please, verify if I made anything wrong or
if there is any other correction:

The problem happens in the siplib/siplib.c file. The problem occurs in line
6570. I found that it only happens using Stackless include files, more
especifically the file object.h You must edit the file siplib\siplib.c
file, go to line 6568 and change:

 --------------------
static sipWrapperType sipWrapper_Type = {
    {
        {
            PyObject_HEAD_INIT(&sipWrapperType_Type)
--------------------
     To this:
--------------------
static sipWrapperType sipWrapper_Type = {
            PyObject_HEAD_INIT(&sipWrapperType_Type)

--------------------
       And in the line 6610 change:
--------------------
            (newfunc)sipWrapper_new,    /* tp_new */
            0,              /* tp_free */
        },
    },
    0,
    0
};

--------------------
     To this:
--------------------
            (newfunc)sipWrapper_new,    /* tp_new */
            0,              /* tp_free */
    0,
    0
};

--------------------

After this change the SIP module compiles correctly.

Phil Thopson, the creator of SIP / PyQt does not understand how this could happen, but the code compiles perfectly under stock Python.

The latest SIP can be downloaded from http://www.riverbankcomputing.com/Downloads/Snapshots/sip4/sip-snapshot-20061228.zip

If you need more information, contact me.

Regards,

Carlos E.






__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list