我收到此链接错误,使用 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 仍然是同样的错误。
我可能做错了什么?