2

我目前正在开发一个用 C++ 编写的 Cygwin/GCC 应用程序。该应用程序需要嵌入 python 来运行插件,我已经使用 Cygwin python 库成功嵌入,并且能够运行简单的 python 文件作为程序的一部分。但是,python 文件现在需要使用 windows GUI 框架 (wxPython),因此我需要能够嵌入 Windows Python 环境,否则我无法在 python 文件中使用该框架。为了做到这一点,我使用这些说明的第 2 步创建了 libpython25.a 。然后我使用 Windows 安装的库/头文件来编译它。但是,当我运行它时,程序会因一些奇怪的调试器输出而崩溃(奇怪的是,调试信息已打开)。

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 ?? ()'

如果有人成功地做到了这一点,我将不胜感激。是否可以在 Cygwin/GCC 程序中嵌入 Windows python?如果不是,我的其他选择是什么?(现在我只能考虑迁移到 VC++,但这会非常激烈,我也不想将 X11 用于 GUI)。

4

2 回答 2

0

不是直接的答案,但您可以将系统分成 2 个进程 - Cygwin 一个(Python 和 C++,没有 wxPython)和 win32 一个(Python 和 wxPython),并通过RPyC、 XML-RPC 等在它们之间进行通信。

于 2009-08-20T20:57:03.483 回答
0

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

You are running code on a 64bit machine (because there is a SysWow64 folder), but my guess is that your python25.dll is 32 bit. What is confusing is that "system32" contains 64 bit DLLs.

+I don't think debug is on, you only see the public symbols.

于 2011-04-12T03:28:12.820 回答