當我試圖把Python WX用C這樣的:在VisualStudio的2005 C/C++中嵌入wxPython的失敗
#include "stdafx.h"
#ifdef _DEBUG
#undef _DEBUG
#include <Python.h>
#define _DEBUG
#else
#include <Python.h>
#endif
int _tmain(int argc, _TCHAR* argv[])
{
PyObject* pyModule;
Py_Initialize();
//_pyModule = PyImport_ImportModule("__main__");
//_pyModule = PyImport_ImportModule("csi");
pyModule = PyImport_ImportModule("wx");
if(!pyModule)
PyErr_Print();
return 0;
}
失敗:
->Traceback (most recent call last):
File "C:\Python27\lib\site-packages\wx-2.8-msw-ansi\wx\__init__.py", line 45, in <module>
from wx._core import *
File "C:\Python27\lib\site-packages\wx-2.8-msw-ansi\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: The specified module could not be found.
可以用MSVC * 90個問題。 dll文件?
我使用VS2005,Python 2.7版,wxPython的2.8.12.1(ANSI)爲Python 2.7
此外MS VC++ 2008/2010可再分發的安裝位置。
感謝您的幫助。
爲什麼要那樣做?你可以使用wxWidgets,因爲它實際上是C++。 –