Boost logo

Boost Users :

Subject: Re: [Boost-users] [python] Linker error when initializing numpy
From: Stian Zeljko Vrba (vrba_at_[hidden])
Date: 2017-11-17 06:01:16


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_at_[hidden]> on behalf of Christian Henning via Boost-users <boost-users_at_[hidden]>
Sent: Thursday, November 16, 2017 9:16:36 PM
To: boost-users_at_[hidden]
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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net