How are you compiling the test progam? Did you set up a test solution? Are you compiling it from command line with cl? Are you trying to use cmake?
Why did you build boost with vcpkg? IIRC, vcpkg/cmake has own conventions; the libraries in the official boost windows distribution do not have 'lib' prefix.
In any case, set up a project in the IDE and adjust linker search paths and libraries to link against (Linker -> Input -> Additional dependencies) in the project properties tab.
________________________________________
From: Boost-users <boost-users-bounces@lists.boost.org > on behalf of Christian Henning via Boost-users <boost-users@lists.boost.org>
Sent: Thursday, November 16, 2017 9:16:36 PM
To: boost-users@lists.boost.org
Cc: Christian Henning
Subject: [Boost-users] [python] Linker error when initializing numpy
Hi all,
I have the latest boost from the master branch and built everything including python. I can see that two python related libs were built:
libboost_python3-vc141-mt-gd-x64-1_66.lib
libboost_numpy3-vc141-mt-gd-x64-1_66.lib
For compiling python I use vcpkg and it's generating python3_d.lib for debug and python3.lib for release.
The cpp code I like to compile is:
#include <iostream>
#include <boost/python.hpp>
#include <boost/python/numpy.hpp>
namespace p = boost::python;
namespace np = boost::python::numpy;
int main()
{
Py_Initialize();
np::initialize();
return 0;
}
A few issues:
1) linker is looking for "boost_python3-vc141-mt-gd-x64-1_66.lib" but I got "libboost_python3-vc141-mt-gd- x64-1_66.lib"
Please tell me how to fix that. For now I just copied the libboost* files and renamed them.
2) Linker error:
"__declspec(dllimport) void __cdecl boost::python::numpy::initialize(bool)"
How can I resolve that?
Thanks,
Christian