[issue5431] cmpfunc in Python 3.0.1 windows installer

2009-03-06 Thread Nigel Galloway

New submission from Nigel Galloway :

C:\Users\Nigel\myPython\iajaar>C:\Users\Nigel\swigwin-1.3.38\swig -
c++ -python -py3  NigelzGLPK.swg

generated a C++ wrapper and a Python file. When I attempted to compile 
the wrapper against Python 3.0.1 it failed see the output log at the 
end of this message.


I decided to modify object.h from C:\Python30\include:

typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *);


typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef int (*cmpfunc)(PyObject *, PyObject *);
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *);


adding the typedef for cmpfunc. It then compiles fine, AND appears to 
work.

C:\Users\Nigel\myPython\iajaar\Python>c:\Python30\python 
sample.iajaar.3.py
* 0: obj =  0.0e+000  infeas = 0.000e+000 (0)
* 2: obj =  7.3e+002  infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Z =  733.3 ; x1 =  33.33 ; x2 =  66.67 ; x3 =  
0.0


Is this good, or should I do something else?



Compile Log:

Build Log  Rebuild started: Project: nigelzGLPK, Configuration: 
Release|Win32
 Command Lines  Creating temporary 
file "c:\Users\Nigel\Documents\Visual Studio 2008
\Projects\nigelzGLPK\nigelzGLPK\Release\RSP1137523960.rsp" with 
contents
[
/O2 /Oi /GL /I "C:\Users\Nigel\Documents\Visual Studio 2008
\Projects\glpk\include" /I "C:\Python30
\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "NIGELZG
LPK_EXPORTS" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy 
/Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP "..\..\..\..\..\myP
ython\iajaar\NigelzGLPK_wrap.cxx"
]
Creating command line "cl.exe @"c:\Users\Nigel\Documents\Visual Studio 
2008
\Projects\nigelzGLPK\nigelzGLPK\Release\RSP1137523960.rsp" /nologo 
/errorReport:prompt"
 Output Window  Compiling...
NigelzGLPK_wrap.cxx
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error 
C2065: 'cmpfunc' : undeclared identifier
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error 
C2146: syntax error : missing '}' before 
identifier 'SwigPyObject_compare'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1772) : error 
C2146: syntax error : missing ';' before 
identifier 'SwigPyObject_compare'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1817) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1818) : error 
C2065: 'tmp' : undeclared identifier
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1825) : error 
C2059: syntax error : 'return'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error 
C2065: 'cmpfunc' : undeclared identifier
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error 
C2146: syntax error : missing '}' before 
identifier 'SwigPyPacked_compare'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1943) : error 
C2146: syntax error : missing ';' before 
identifier 'SwigPyPacked_compare'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1988) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1989) : error 
C2065: 'tmp' : undeclared identifier
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1996) : error 
C2059: syntax error : 'return'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error 
C2143: syntax error : missing ';' before '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(1997) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2001) : error 
C2143: syntax error : missing ';' before '{'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2001) : error 
C2447: '{' : missing function header (old-style formal list?)
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2400) : error 
C3861: 'SwigPyPacked_New': identifier not found
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error 
C2143: syntax error : missing ';' before '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2635) : error 
C2059: syntax error : '}'
..\..\..\..\..\myPython\iajaar\NigelzGLPK_wrap.cxx(2674) : error 
C2065: 'swig_types' : undeclared id

[issue5431] cmpfunc in Python 3.0.1 windows installer

2009-03-10 Thread Nigel Galloway

Nigel Galloway  added the comment:

Not quite an answer to the question. I have built this wrapper with 
the change to Python indicated. It seems to work. It does not complain 
about unresolved references. Is this satisfactory for 3.0.1, with 
perhaps a change to SWIG from 3.1. Or must I obtain Python 3.0 and 
start again?

--
message_count: 4.0 -> 5.0
status: closed -> open

___
Python tracker 
<http://bugs.python.org/issue5431>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com