[capi-sig] Problems linking python25.lib into my executable using MSVC2008 Express

Jeremy Friesner jaf at meyersound.com
Thu May 22 22:51:57 CEST 2008


Hi all,

Apologies if this is a common question, I googled for it and couldn't find any 
good answers.

I've got a C++ program that includes an embedded Python interpreter, and under 
Linux and MacOS/X everything works fine.  It's a Qt4-based program, so all I 
needed to do was add -lpython2.5 to the LIBS variable in my .pro file.

Now I'm trying to get the same program working under Windows, but when I get 
to the link stage I run into trouble.  I've compiled the Python 2.5 library 
using MSVC2008 Express (and the project files in the PCBuild8 sub-folder), 
but when I try to link my own app (adding python25.lib to my LIBS line, of 
course), I get the errors shown below.

I notice that I only get link errors about the global objects exported in the 
Python25.lib library (e.g. _PyList_Type)... I don't get any errors related to 
exported Python functions.  Is there something special I need to do in order 
to get MSVC2008's linker to resolved exported global objects?

Thanks,
Jeremy

	e:\msvc2008\vc\bin\nmake.exe -f Makefile.Release
	link /LIBPATH:"e:
\Qt\4.4.0\lib" /NOLOGO /LIBPATH:../../../../../software/3rdparty/libsndfile/win32 /LIBPATH:../../../../../software/3rdparty/libsamplerate/win32 /LIBPATH:../../../../../software/3rdparty/libsamplerate /LIBPATH:../../../../../software/3rdparty/python/pcbuild8/win32 /LIBPATH:../../../../../software/libs/muscle/zlib/zlib /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"objects\CueStation.intermediate.manifest" /SUBSYSTEM:WINDOWS 
"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' 
version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' 
processorArchitecture='*'" /OUT:release\CueStation.exe @C:
\DOCUME~1\JEREMY~1\LOCALS~1\Temp\nm48C.tmp 
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyList_Type referenced in function "long __cdecl 
muscle::ParsePythonSequence(struct _object *,class muscle::Message 
&)" (?ParsePythonSequence at muscle@@YAJPAU_object@@AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
_PyList_Type
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyDict_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyUnicode_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyComplex_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyString_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
_PyString_Type
SysexSubcueEditor.obj : error LNK2001: unresolved external symbol 
_PyString_Type
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyFloat_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyLong_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
_PyLong_Type
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyInt_Type referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
_PyInt_Type
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
__Py_NoneStruct referenced in function "long __cdecl 
muscle::AddPyObjectToMessage(class muscle::String const &,struct _object 
*,class muscle::Message 
&)" (?AddPyObjectToMessage at muscle@@YAJABVString at 1@PAU_object@@AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
__Py_NoneStruct
SysexSubcueEditor.obj : error LNK2001: unresolved external symbol 
__Py_NoneStruct
PythonUtilityFunctions.obj : error LNK2019: unresolved external symbol 
_PyExc_RuntimeError referenced in function "long __cdecl 
muscle::ParsePythonArgs(struct _object *,struct _object *,class 
muscle::Message 
&)" (?ParsePythonArgs at muscle@@YAJPAU_object@@0AAVMessage at 1@@Z)
PythonTemplateUtilityFunctions.obj : error LNK2001: unresolved external symbol 
_PyExc_RuntimeError
SysexSubcueEditor.obj : error LNK2001: unresolved external symbol 
_PyExc_RuntimeError
PythonTemplateUtilityFunctions.obj : error LNK2019: unresolved external symbol 
__Py_TrueStruct referenced in function "long __cdecl 
qnet::RegenerateSysexDataFromTemplate(class qnet::IPythonTemplateEditor const 
&,class qnet::SysexEntry 
&)" (?RegenerateSysexDataFromTemplate at qnet@@YAJABVIPythonTemplateEditor at 1@AAVSysexEntry at 1@@Z)
release\CueStation.exe : fatal error LNK1120: 11 unresolved externals


More information about the capi-sig mailing list