Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Python can't link using downloaded pre-compiled binaries
From: Bo Zhou (bo.schwarzstein_at_[hidden])
Date: 2017-05-30 06:42:09


Link your C++ module with Python27.lib .

Boost.Python is only the wrapper of Python binding so if your module is
static, it absolutely needs the Python27.lib . Even we might use dynamic
boost.python , but host application might still require Python27.lib if
there are any Python APIs called.

On Tue, May 30, 2017 at 3:01 PM, Gavin Lambert via Boost-users <
boost-users_at_[hidden]> wrote:

> On 25/05/2017 15:01, Heng Zhou wrote:
>
>> (5) Build under x64 configuration and got errors:
>> 1>Source.obj : error LNK2001: unresolved external symbol
>> __imp_PyString_Type
>> 1>Source.obj : error LNK2001: unresolved external symbol
>> __imp__Py_NoneStruct
>> 1>C:\...\ConsoleApplication1\x64\Release\ConsoleApplication1.dll : fatal
>> error LNK1120: 2 unresolved externals
>>
>> I have no idea what the matter is. I will greatly appreciate it if you
>> can help me out.
>>
>
> I don't use Boost.Python myself so I can't give you more specific
> instructions, but unresolved externals of __imp_* symbols mean that you
> need to add an import library (the .lib) for a DLL, either by adding a
> reference to it or by adding it to the linker project settings.
>
> Given the names of the symbols, it's most likely one of the Python runtime
> DLLs.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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