473,698 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pyrex problem - Py_NoneStruct

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

Jul 18 '05 #1
3 2304
"Gary Stephenson" <ga***@ihug.com .au> writes:
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
Jul 18 '05 #2
Hi John,

"John J. Lee" <jj*@pobox.co m> wrote in message
news:87******** ****@pobox.com. ..
"Gary Stephenson" <ga***@ihug.com .au> writes:
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.


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, try .... please... <g>
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(XppParam List pList, long numInt)
BOOL _ret(XppParamLi st pList)
unsigned long _conRLockC( void * hString, char **ppString, unsigned
long *ulSize)
unsigned long _conUnlockC( void * hString)

cdef public BOOL C_OX_PYINITIALI ZE( 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 )
Jul 18 '05 #3
"Gary Stephenson" <ga***@ihug.com .au> writes:
[...]
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
:-(

[...]

Your message appeared on the list:

http://lists.copyleft.no/pipermail/p...er/thread.html
John
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2033
by: Kyler Laird | last post by:
I need to submit C/C++ code for a class. (It's not a programming class. The choice of language is inertial. I think that it mostly serves to distract students from the course subject.) I'm fairly fluent with C but it hurts to think about writing in C when Python is *so* much more appropriate for these operations. I'd like to keep my sanity and satisfy the course requirements by programming in Python and converting the code to C. It...
1
1670
by: Paul Prescod | last post by:
PyCon 2004 Slides on "Extending Python with Pyrex" PDF: http://www.prescod.net/pyrex/ExtendingPythonWithPyrex.pdf PPT: http://www.prescod.net/pyrex/ExtendingPythonWithPyrex.ppt Pycon 2004 Slides on "Optimizing Python code with Pyrex" PDF: http://www.prescod.net/pyrex/OptimizingPythonWithPyrex.pdf PPT: http://www.prescod.net/pyrex/OptimizingPythonWithPyrex.ppt I hope this helps me. Please report any mistakes.
4
2071
by: Kyler Laird | last post by:
I mentioned earlier that I started using Pyrex because I'm taking a computer vision course that requires all assignments to be submitted as C(++). While I could write C it would hurt me to do so and certainly distract me from the computer vision aspects. I like using Python these days and Pyrex looked like a good solution. (BTW, on the last assignment I saw several messages from someone having difficulty with segfaults due to memory...
6
1934
by: SeeBelow | last post by:
I just read "about Pyrex" at http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/version/Doc/About.html It seems that it is not compiled into machine code, as C would be, and therefore it does not offer the only valid reason for using C, which is for an increase in execution speed. The word "speed" does not appear on the above web page. Am I wrong about this? Perhaps I don't understand how Pyrex works.
1
3576
by: Martin Bless | last post by:
Now that I've got my extension building machine using the VC++ Toolkit 2003 up and running I'm keen on using Pyrex (Pyrex-0.9.3, Python-2.4.0). But the definition of the swig_sources() method seems to have changed. When I try to build the examples from Pyrex I get a TypeError: c:\Pyrex-0.9.3\Demos> python Setup.py build_ext --inplace
4
1637
by: Carl | last post by:
I have recently started to use Pyrex and am amazed by it's useability. Are there any alternatives to Pyrex? One thing that I haven't figured out is how to embed pure C/C++ source code into Pyrex. For example, if you have a bunch of C files that you want to use together with some Python code snippets, how do you practically achieve this using Pyrex? I have come to the conclusion that it is not possible without some rewriting and...
27
3972
by: Julien Fiore | last post by:
Do you wand to install Pyrex on Windows ? Here is a step-by-step guide explaining: A) how to install Pyrex on Windows XP. B) how to compile a Pyrex module. Julien Fiore, U. of Geneva
11
1985
by: Jim Lewis | last post by:
Has anyone found a good link on exactly how to speed up code using pyrex? I found various info but the focus is usually not on code speedup.
7
2043
by: Jim Lewis | last post by:
I'm trying to move a function into pyrex for speed. The python side needs to pass a list to the pyrex function. Do I need to convert to array or something so pyrex can generate tight code? I'm not clear how to do this.
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.