[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
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
Hi all,
OK, it seems that I have lost some of my boost zen. I remember now that
"libboost*.lib" are the static libs and that "boost*.lib" are dynamic
variant. I have built both and the linking now works. It seems that linking
to static boost libs is not supported on Windows with Visual Studio 2017.
Not sure why?
Regards,
Christian
On Fri, Nov 17, 2017 at 1:01 AM, Stian Zeljko Vrba
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
on behalf of Christian Henning via Boost-users 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
#include 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
Hi degski, thanks for your insight. Is it true to say, that by default boost::python is looking for the shared variants, like "boost_python3-vc141-mt-gd-x64-1_66"?. Do you know how to force boost to use static libs? Thanks! On Fri, Nov 17, 2017 at 4:32 PM, degski via Boost-users < boost-users@lists.boost.org> wrote:
On 17 November 2017 at 09:16, Christian Henning via Boost-users < boost-users@lists.boost.org> wrote:
It seems that linking to static boost libs is not supported on Windows with Visual Studio 2017. Not sure why?
This is not the case, linking to static libs works just fine.
degski
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
OK, I agree that linking to static libs works for boost::python out of the
box. I think the problem lies with boost::python::numpy which only looks
for dynamic libs.
Regards,
Christian
On Fri, Nov 17, 2017 at 4:37 PM, Christian Henning
Hi degski,
thanks for your insight.
Is it true to say, that by default boost::python is looking for the shared variants, like "boost_python3-vc141-mt-gd-x64-1_66"?. Do you know how to force boost to use static libs?
Thanks!
On Fri, Nov 17, 2017 at 4:32 PM, degski via Boost-users < boost-users@lists.boost.org> wrote:
On 17 November 2017 at 09:16, Christian Henning via Boost-users < boost-users@lists.boost.org> wrote:
It seems that linking to static boost libs is not supported on Windows with Visual Studio 2017. Not sure why?
This is not the case, linking to static libs works just fine.
degski
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of degski via Boost-users
Sent: 17 November 2017 21:33
To: boost-users@lists.boost.org
Cc: degski
Subject: Re: [Boost-users] [python] Linker error when initializing numpy
On 17 November 2017 at 09:16, Christian Henning via Boost-users
participants (4)
-
Christian Henning
-
degski
-
Paul A. Bristow
-
Stian Zeljko Vrba