如何使用vsc++ 6.0在c++应用程序中嵌入Python 2.4
How to embed Python 2.4 in C++ application using VS C++ 6.0?
我得到这个链接错误,使用Python 2.4和MS vc++ 6:
Linking...
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__Py_Finalize
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyErr_Occurred
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyErr_Print
testPyEmb.obj : error LNK2001: unresolved external symbol _printf
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyInt_AsLong
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyObject_CallObject
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyTuple_SetItem
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyInt_FromLong
testPyEmb.obj : error LNK2001: unresolved external symbol _atoi
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyTuple_New
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyCallable_Check
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyObject_GetAttrString
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyImport_Import
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__PyString_FromString
testPyEmb.obj : error LNK2001: unresolved external symbol __imp__Py_Initialize
testPyEmb.obj : error LNK2001: unresolved external symbol _fprintf
testPyEmb.obj : error LNK2001: unresolved external symbol __iob
将此添加到我的源文件中没有帮助:
#undef _DEBUG
我修改了pyconfig.h以禁用调试模式并强制使用python24。Lib而不是python24_d。Lib如下所示:http://tutorial.debashis.net/?p=57&cpage=1还是一样的错误
我做错了什么?
既然你说你是链接到。lib,它可能是你已经安装了64位版本的Python,因此链接到64位版本的。lib文件,但你的构建配置是32位的(我怀疑)。转到配置管理器,将其更改为64位。
希望这对你有帮助。马吕斯。
相关文章:
- 我想通过带有C++和Python的插件创建一个可扩展的应用程序
- 将FFMpeg AVFrame对象从C++应用程序流式传输到Python的最佳方法?
- 使用 pipe() 和 fdopen() 将数据从 Python 脚本传递到 Windows 中的C++应用程序
- 在Qt应用程序中包含Python.h会导致对Qt函数的未定义引用
- SWIG和Mingw-64与Python一起使用...不是有效的 Win32 应用程序
- 在使用 cmake 和 pybind11 构建示例应用程序时找不到 Python.h
- 与 Python 中子进程中的另一个应用程序的交互式会话
- 如何分发调用Python C++应用程序?
- 如何隐藏嵌入在 c++ 应用程序中的 python 代码
- 为什么无法在 Cocoa 应用程序调用的 C++ func 中嵌入自定义 Python 模块
- 在 C++ 应用程序中嵌入 Python 环境
- 调试从 Linux 中的另一个C++应用程序启动的 python 脚本
- 将 python 嵌入我的应用程序时内存泄漏
- 在我的Qt C++应用程序中使用Anaconda的Python
- numpy.core.multiarray在通过Xcode中开发的C 应用程序调用Python模块时未能导入
- 如何中断嵌入C++应用程序中的python解释器
- 在另一个应用程序中嵌入python时,如何在子模块(即scipy.optimize.nnls)中导入或调用函数
- 可以加载C/C++和Python插件的应用程序
- 将数据从 Python 应用程序传递到正在运行的 C++ 应用程序
- 在python中嵌入c++代码会使python应用程序更快吗?