【问题标题】:Embedding Python into Qt Applications将 Python 嵌入到 Qt 应用程序中
【发布时间】:2011-09-07 06:43:32
【问题描述】:

我想在我的 Qt 应用程序中使用 Python。

#project.pro
#...
LIBS += -L/path_to_python32/libs/ -lpython32
INCLUDEPATH += /path_to_python32/include
#...

构建问题

undefined reference to '_imp__Py_Initialize'

必须链接哪个库或有什么问题?

我在 x64 上使用 MinGW...哎呀,也许这就是问题所在 - Python 的 x64 库

【问题讨论】:

  • 已解决。这是关于将 64 位库与 32 位应用程序一起使用。为什么我必须一直重复同样的错误:D

标签: windows qt python-3.x mingw python-embedding


【解决方案1】:

如果您想用 Python 构建应用程序,请使用 PyQt。如果您想将 Python 解释器集成到您的应用程序中,请使用 PythonQt

【讨论】:

  • 感谢您的回复...我只想使用 Python/C API,这足以满足我的需要。
  • 既然 Python 只是一门语言,为什么要在不扩展 Python 的情况下访问 API?
猜你喜欢
  • 2015-01-18
  • 2013-08-30
  • 1970-01-01
  • 2016-02-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多