Friday 15 June 2012

Boost 1.55 Python with Windows Visual Studio 2013, Link Error -



Boost 1.55 Python with Windows Visual Studio 2013, Link Error -

i download boost1.55 zip official website , build command bootstrap , b2. , tried illustration code, has link error.

1>link : fatal error lnk1104: cannot open file 'libboost_python-vc120-mt-gd-1_55.lib'

below did.

new project win32 console application, dll empty.

add include path, library path in vc++ directories below.

include directories: c:\boost\boost_1_55_0;c:\python27\include library directories: c:\boost\boost_1_55_0\libs;c:\python27\libs

.

#define boost_python_static_lib #include <boost/python.hpp> using namespace boost::python; struct world { void set(std::string msg) { this->msg = msg; } std::string greet() { homecoming msg; } std::string msg; }; boost_python_module(hello) { class_<world>("world") .def("greet", &world::greet) .def("set", &world::set); }

edit

if add together library directory, c:\boost_1_55_0\stage\liblike reply below, create many errors happen, around 200 below part of errors.

1>------ build started: project: hello, configuration: debug win32 ------ 1> hello.cpp 1>c:\python27\include\pymath.h(22): warning c4273: 'round' : inconsistent dll linkage 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h(516) : see previous definition of 'round' 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(190): warning c4273: '_hypot' : inconsistent dll linkage 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h(538) : see previous definition of '_hypot' 1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(206): warning c4273: 'round' : inconsistent dll linkage 1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h(516) : see previous definition of 'round' 1>c:\boost_1_55_0\boost\python\opaque_pointer_converter.hpp : warning c4819: file contains character cannot represented in current code page (949). save file in unicode format prevent info loss 1>c:\boost_1_55_0\boost\python\return_opaque_pointer.hpp : warning c4819: file contains character cannot represented in current code page (949). save file in unicode format prevent info loss 1> creating library c:\users\user\documents\visual studio 2013\projects\hello\debug\hello.lib , object c:\users\user\documents\visual studio 2013\projects\hello\debug\hello.exp 1>hello.obj : error lnk2019: unresolved external symbol __imp__pystring_fromstringandsize referenced in function "public: struct _object * __thiscall boost::python::to_python_value,class std::allocator > const &>::operator()(class std::basic_string,class std::allocator > const &)const " (??r?$to_python_value@abv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@@python@boost@@qbepau_object@@abv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@@z) 1>libboost_python-vc120-mt-gd-1_55.lib(builtin_converters.obj) : error lnk2001: unresolved external symbol __imp__pystring_fromstringandsize 1>libboost_python-vc120-mt-gd-1_55.lib(str.obj) : error lnk2001: unresolved external symbol __imp__pystring_fromstringandsize 1>libboost_python-vc120-mt-gd-1_55.lib(function_doc_signature.obj) : error lnk2001: unresolved external symbol __imp__pystring_fromstringandsize 1>libboost_python-vc120-mt-gd-1_55.lib(list.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(tuple.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(function_doc_signature.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(object_protocol.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(pickle_support.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(dict.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(str.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(from_python.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(function.obj) : error lnk2001: unresolved external symbol __imp___py_nonestruct 1>libboost_python-vc120-mt-gd-1_55.lib(module.obj) : error lnk2001:

the "library directory" should reference c:\boost_1_55_0\stage\lib instead of c:\boost\boost_1_55_0\libs.

python-2.7 windows-8 visual-studio-2013 boost-python

No comments:

Post a Comment