From: Bob H. <bh...@co...> - 2014-10-27 22:59:11
|
On 10/27/2014 4:19 PM, Paul Silvis wrote: > I'm trying to wrap an existing dll that references other dlls. I'm using > Visual Studio 2013 and Python27 (32 bit). When I get to the linker it > complains about unresolved externals: > > __Py_NotImplementedStruct > _PyBool_Type > _PyFloat_Type > _PyClass_Type > > ... and so on. I know that other Python symbols _are_ being found > (Python27\libs\python27.lib is a linker input, and the /verbose mode shows > me all sorts of symbols being found there), but don't understand where these > should come from. > > Any ideas? "PyBool_Type" is a data type defined in the Python source code, Objects/boolobject.c (line 150 in Python 2.7.7): PyTypeObject PyBool_Type = {... The definition of "Py_NotImplementedStruct" can be found in Objects/object.c (again, Python 2.7.7): PyObject _Py_NotImplementedStruct = {... At a guess, [a] you're project is not linking to the correct Python static library (e.g., python27.lib under Windows), [b] those symbols in the library are not publicly visible, or [c] those symbols aren't actually in your library (for some reason). You might use a utility to dump the strings in the "python27.lib" file to see if those symbols appear. For example: $ strings python27.lib | grep PyBool_Type __imp_PyBool_Type __imp_PyBool_Type PyBool_Type $ strings python27.lib | grep Py_NotImplementedStruct __imp__Py_NotImplementedStruct __imp__Py_NotImplementedStruct _Py_NotImplementedStruct |