[C++-sig] Problem Compiling Boost.Python Example

Wojciech Mamrak wmamrak at gmail.com
Fri Apr 6 12:02:47 CEST 2012


Hi,

I am lost. Do you wan't to build boost::python libraries or an example
using them? Bjam is used for the former only.

regards

W dniu 6 kwietnia 2012 11:14 użytkownik Payam Shiva
<payaam.shivaa at gmail.com> napisał:
> I'm totally new to Boost.Python, so I'm trying to follow the tutorial.
> It says to cd to the tutorial folder and invoke bjam. When I do this,
> it still gives me the same error message.
>
> I tried using VS too. I did the following:
> 1. I created a new project (W32 Project and I chose DLL output)
> 2. I added C:\Boost\boost_1_49_0 and C:\Python27\include to C/C++
> additional include directories in property manager
> 3. I added C:\Boost\lib32 and C:\Python27\libs to additional linker
> directories in property manager
> 4. I choose not to use precompiled headers
> 5. I delete the automatically created files, create a new C++ source
> file named hello.cpp and copy the contents of hello world example from
> the tutorial in it.
> 6. I build the project. It gives me the following message:
>
> 1>------ Build started: Project: BPTest, Configuration: Release Win32 ------
> 1>Build started 4/6/2012 1:25:35 PM.
> 1>InitializeBuildStatus:
> 1>  Touching "Release\BPTest.unsuccessfulbuild".
> 1>ClCompile:
> 1>  hello.cpp
> 1>Link:
> 1>     Creating library c:\users\payaam\documents\visual studio
> 2010\Projects\BPTest\Release\BPTest.lib and object
> c:\users\payaam\documents\visual studio
> 2010\Projects\BPTest\Release\BPTest.exp
> 1>hello.obj : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
> 1>hello.obj : error LNK2001: unresolved external symbol __imp__PyString_Type
> 1>c:\users\payaam\documents\visual studio
> 2010\Projects\BPTest\Release\BPTest.dll : fatal error LNK1120: 2
> unresolved externals
> 1>
> 1>Build FAILED.
> 1>
> 1>Time Elapsed 00:00:10.12
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
>
>
>
> Please help me understand what to do to build this simple example,
> under VS or bjam.
>
> Thanks
>
> On 4/6/12, Adam Preble <adam.preble at gmail.com> wrote:
>> Now that you have the binaries, you should be ready to use them.  There
>> should be no need to configure jam files.  If you start pointing to those
>> libraries in your Visual Studio project, they should link with your code.
>>  This assumes the binaries you're using mate up with how you'd building
>> your Visual Studio project (32-bit, 64-bit, that stuff).
>>
>> On Fri, Apr 6, 2012 at 12:12 AM, Payam Shiva <payaam.shivaa at gmail.com>wrote:
>>
>>> I downloaded the prebuilt binaries from here: http://boost.teeks99.com/
>>> but I don't know how to use them. Right now, Boost source is
>>> decompressed in C:\Boost\boost_1_49_0 and the prebuilt binaries are in
>>> C:\Boost\lib32. I couldn't find anything in the jamfile about
>>> binaries. Can you help me configure them?
>>>
>>> Thanks
>>> _______________________________________________
>>> Cplusplus-sig mailing list
>>> Cplusplus-sig at python.org
>>> http://mail.python.org/mailman/listinfo/cplusplus-sig
>>>
>>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig


More information about the Cplusplus-sig mailing list