Implementing Windows Python in Cygwin / GCC C ++ Program

I am currently working on a Cygwin / GCC application written in C ++. The application requires python injection to run plugins, I have successfully implemented using the python Cygwin libraries and was able to run simple python files as part of a program. However, python files now require the use of the Windows GUI framework (wxPython), and so I need to be able to embed the Windows Python environment, otherwise I cannot use the framework in python files. In an attempt to do this, I created libpython25.a using step 2 of these instructions . Then I used the Windows installation library / header files to compile it. However, when I run it, the program crashes with some weird debugger output (debug info is included, oddly enough).

gdb: unknown target exception 0xc0000008 at 0x77139a13
Program received signal ?, Unknown signal.
[Switching to thread 2216.0x119c]
0x77139a13 in ntdll!RtlLockMemoryZone () from /cygdrive/c/Windows/system32/ntdll.dll
(gdb) where
#0  0x77139a13 in ntdll!RtlLockMemoryZone () from /cygdrive/c/Windows/system32/ntdll.dll
#1  0x030c1c7c in ?? ()
#2  0x030c1c80 in ?? ()
#3  0x1e0d0e80 in python25!_PyTime_DoubleToTimet ()
   from /cygdrive/c/Windows/SysWOW64/python25.dll
#4  0x00000000 in ?? ()'

      

If anyone has done this successfully, I would be very grateful for the help. Is it possible to embed Windows python in Cygwin / GCC program? If not, what are my other options? (Right now I can only think of switching to VC ++, but that would be pretty radical, and I also don't want to use X11 for the GUI).

+2


source to share


2 answers


Not a direct answer, but you can split the system into 2 processes - Cygwin (Python and C ++, no wxPython) and win32 one (Python and wxPython) and communicate between them using RPyC , XML-RPC, etc.



0


source


It looks like you have a 32 bit / 64 bit mismatch.

You are running the code on a 64 bit machine (because there is a SysWow64 folder), but I assume your python25.dll is 32 bit. What is misleading is that "system32" contains 64-bit DLLs.



+ I don't think debugging is enabled, you only see public symbols.

0


source







All Articles