Pyrex problem - Py_NoneStruct

  • Thread starter Gary Stephenson
  • Start date
G

Gary Stephenson

I'm getting a clean generate, compile and link from my .pyx script, but when
I attempt to run the resultant .exe, I get:

"The procedure entry point Py_NoneStruct could not be located in the
dynamic link library python23.dll"

Can anybody provide me with a clue here? I've already cut down my script to
remove all references to None, Py_None, NULLs, etc, but to no avail. fwiw
I'm using latest Pyrex and ActiveState build 232.

many tias,

gary
 
J

John J. Lee

Gary Stephenson said:
I'm getting a clean generate, compile and link from my .pyx script, but when
I attempt to run the resultant .exe, I get:

Hmm, what resultant .exe? Are you using py2exe or similar, or is
there a feature of Pyrex I haven't noticed? I've always ended up with
a .so / .DLL.

"The procedure entry point Py_NoneStruct could not be located in the
dynamic link library python23.dll"
[...]

Had this before, but forget what the problem is.

Try posting some Pyrex code (the pyrex list is probably a better place
than here).


John
 
G

Gary Stephenson

Hi John,

John J. Lee said:
Hmm, what resultant .exe? Are you using py2exe or similar, or is
there a feature of Pyrex I haven't noticed? I've always ended up with
a .so / .DLL.

Err, yes ... I have used Pyrex before (successfully) using distutils to
produce a .DLL. In this case, however, I am effectively attempting to embed
Python within another language (Xbase++), so I am compiling the pyrex
generated .c file using MSVC6 into an ..obj file and linking that into my
Xbase++ app. It would appear that my problems arise from incorrect switches
to cl.exe. fwiw, the switches I"m using are: /c /Zl /Tc

I've searched high and low for some guidance on what the correct switches
might be, but alas to no avail thus far. :-(
"The procedure entry point Py_NoneStruct could not be located in the
dynamic link library python23.dll"
[...]

Had this before, but forget what the problem is.

Try said:
Try posting some Pyrex code (the pyrex list is probably a better place
than here).

I have attempted to post this message along with the .pyx file to the pyrex
list, but it would appear there is something wrong with my subscription as
I have received neither my own message not anybody else's since subscribing
:-(

cheers,

gary

The following is a somewhat cut down version of my .pyx file whichl produces
the error:

from scanners import xppScanner

ctypedef unsigned long ULONG
ctypedef void * XppParamList
ctypedef long BOOL
ctypedef void * ContainerHandle

cdef extern from "windows.h" :
pass

cdef extern from "xppdef.h" :
pass

cdef extern from "xppcon.h" :
ULONG _conGetNL( void * hNumeric, long *nlValue)
void * _conParam(void * pList, unsigned long paramIndex, long
*bReference)
void * _conPutC( void * hDest, char *string)
void * _conPut( void * hDest, void * hSrc)
BOOL _retnl(XppParamList pList, long numInt)
BOOL _ret(XppParamList pList)
unsigned long _conRLockC( void * hString, char **ppString, unsigned
long *ulSize)
unsigned long _conUnlockC( void * hString)

cdef public BOOL C_OX_PYINITIALIZE( XppParamList pList ) :
Py_Initialize()
_ret( pList )

cdef public BOOL C_OX_PYFINALIZE( XppParamList pList ) :
Py_Finalize()
_ret( pList )

cdef public BOOL C_OX_XPPSCANNER( XppParamList pList ) :
cdef ContainerHandle ch1
cdef ULONG nRslt,nLen
cdef BOOL pRef
cdef object oScan,cStr

ch1 = _conParam( pList, 1, &pRef )
cStr = "test.prg"
oScan = xppScanner( cStr ).gen()
nRslt = <ULONG>oScan
_retnl( pList, nRslt )

cdef public BOOL C_OX_XPPSCANNER_NEXTTOKEN( XppParamList pList ) :
cdef ContainerHandle ch1,ch2,ch3
cdef ULONG nLen
cdef BOOL pRef

ch1 = _conParam( pList, 1, &pRef )
ch2 = _conParam( pList, 2, &pRef )
ch3 = _conParam( pList, 3, &pRef )
_conGetNL( ch1, <long*>&nLen )
oScan = <object>nLen
cTyp,cVal = oScan.next()
_conPutC( ch2,cTyp )
_conPutC( ch3,cVal )
_ret( pList )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top