Fail to build Boost Python Tutorial: LNK1120: 55 unresolved externals
Dear all, I try to learn boost and in particular the Python extension part. But I am already failing with building the tutorial. I am quite a beginner with compiling in C++ I use a Win10 64bit System. I have to use VS2015, because for a proprietary library I have to compile later in msvc120 (64bit). VS2017 is installed on the computer as well. I tried to following for compilation 1. Launch the "Developer Command Prompt for VS2015" 2. Setting Python environment: "C:\Users\schmmark\Anaconda3\Scripts\activate.bat" "C:\Users\schmmark\Anaconda3\envs\py36" 3. cd C:\Users\schmmark\Downloads\boost_1_69_0\boost_1_69_0 4. bootstrap.bat (successful) 5. b2.exe toolset=msvc-14.0 address-model=64 (successful) 6. cd libs\python\example\tutorial 7. ..\..\..\..\bjam.exe toolset=msvc-14.0 address-model=64 --debug-configuration I modified the Jamfile from tutorial folder and Jamroot from example folder as can be found in the attachment. I get the error `hello_ext.pyd : fatal error LNK1120: 55 unresolved externals` A complete output of my command prompt is attached as well. May my problem be * wrong import of python library? I try to use a wildcard in lib boost_python instead of `boost_python36-vc140-mt-x64-1_69` But the error stays the same when I rename it * Some issues with 32bit and 64bit detection? * Am I missing some imports? Thanks in advance for your support Markus
On Tue, Mar 19, 2019 at 3:52 PM Markus Johann Schmidt <schmmark@ethz.ch> wrote:
A complete output of my command prompt is attached as well.
May my problem be
wrong import of python library? I try to use a wildcard in lib boost_python instead of `boost_python36-vc140-mt-x64-1_69` But the error stays the same when I rename it Some issues with 32bit and 64bit detection? Am I missing some imports?
Looks like issues with MSVC's runtime libraries. Maybe rename the other Visual Studio version's installation directories temporarily to avoid wrong versions being picked up? I have not tried following the tutorial myself, though. Have not used Boost on Windows in a decade.
Dear Stefan, might indeed be the case. Now I compiled the sources again with the VS2017 command prompt. When I then try to compile the tutorial, I get the strange output C:\Users\schmmark\user-config.jam:3: Unescaped special character in argument 'C:Program notice: [msvc-cfg] msvc-14.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe' notice: [msvc-cfg] msvc-12.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe' notice: [msvc-cfg] msvc-11.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe' notice: [msvc-cfg] msvc-14.1 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe' notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe' ''C:Program' 'Files' '(x86)Microsoft' 'Visual' 'Studio' '12.0VCbincl.exe'' for msvc, condition <toolset>msvc-12.0 [...] notice: Loading project-config configuration file 'project-config.jam' from '../../../..'. notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe' for msvc, condition <toolset>msvc-14.1 And finally LINK : fatal error LNK1181: cannot open input file 'boost_python36-vc141-mt-x64-1_69.lib' When I change the entry in the project-config.jam to `msvc : 12.0` the notice of using msvc-14.1 vanishes, but the LNK error still comes up. ________________________________ From: Stefan Ring <stefanrin@gmail.com> Sent: 19 March 2019 17:20:03 To: Development of Python/C++ integration Cc: Schmidt Markus Johann Subject: Re: [C++-sig] Fail to build Boost Python Tutorial: LNK1120: 55 unresolved externals On Tue, Mar 19, 2019 at 3:52 PM Markus Johann Schmidt <schmmark@ethz.ch> wrote:
A complete output of my command prompt is attached as well.
May my problem be
wrong import of python library? I try to use a wildcard in lib boost_python instead of `boost_python36-vc140-mt-x64-1_69` But the error stays the same when I rename it Some issues with 32bit and 64bit detection? Am I missing some imports?
Looks like issues with MSVC's runtime libraries. Maybe rename the other Visual Studio version's installation directories temporarily to avoid wrong versions being picked up? I have not tried following the tutorial myself, though. Have not used Boost on Windows in a decade.
participants (3)
-
Markus Johann Schmidt -
Schmidt Markus Johann -
Stefan Ring