On 09/09/2010 11:37 PM, dhruva wrote:
Hi,
On Fri, Sep 10, 2010 at 1:33 AM, Geoff Hilton
wrote: ComputeEntropy.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual unsigned int __thiscall boost::python::objects::py_function_impl_base::max_arity(void)const " (__imp_?max_arity@py_function_impl_base@objects@python@boost@@UBEIXZ) ComputeEntropy.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall boost::python::objects::py_function_impl_base::~py_function_impl_base(void)" (__imp_??1py_function_impl_base@objects@python@boost@@UAE@XZ) ComputeEntropy.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::python::api::object __cdecl
Based on the errors, I suspect that the linker is not picking up the boost python lib for linking! IIRC, there is a way to get the command line options that would get sent to the MSVC linker. Go to the project in which you have added the extra libraries to link with, in the same dialog box somewhere at the bottom, you can see the result of the information you set in a way it gets sent to the linker. Please examine that to see if you see "libboost_python3-vc90-mt-1_44.lib". I hope you have added the folder containing the libs in the lib search path (which translates to -L option to the linker).
As a quick and dirty fix to avoid tweaking the project settings manually: Add the following line in a top level header that gets included in files that use boost.python Make sure you have the library search path set or try putting absolute path in the pragma. #pragma comment( lib, "libboost_python3-vc90-mt-1_44" )
PS: It has been over 2 years since I have worked on Windows environment and I have no access to a windows box to try things out myself. Also, I have not used boost.python and I am troubleshooting more from a generic perspective. My suggestions are based on tough memorable experiences try to solve them. My memory might be rusty.
-dhruva
It definitely finds the lib. It looks like it might not be (or no longer is?) binary compatible. Any other hints would be great though! Thanks very much, Geoff