Help with Boost Python to wrap C++ functions

My immediate goal is to just get a c++ ‘hello world’ available in my standard python as per the getting started examples (boost.org)…then later, get it in the blender python as this person was able to do

http://www.blender.org/forum/viewtopic.php?t=17212&sid=afa426981f8a68dd3b444fa33cf64904

later, it would be cool to attempt it with something more complicated, but for now, I can’t seem to get past the most basic of steps.

The problem(s) is(are) as follows…this is probably overly detailed and meant for a different forum but since the end goal is Blender, I figured I would document my struggles so that others may learn from them.

Win 7 Pro 64 bit
MS Visual Studio 2008
Python 3.2 64 bit in C:\Python32
downloaded the boost libraries, unpacked to C:\dev\boost_1_46_1
bootsrap to set up bjam

following all the instructions here:

(getting set up with boost)…accomplished both the examples!
http://www.boost.org/doc/libs/1_46_1/more/getting_started/windows.html

(building boost python specifically)…some difficulty, possible culprit

http://www.boost.org/doc/libs/1_46_1/libs/python/doc/building.html
http://www.boost.org/doc/libs/1_46_1/libs/python/doc/tutorial/doc/html/index.html

I couldn’t build boost python at first (literally all other libraries build fine except python) until I found this link (in Chinese but translated well enough for me to follow the direction).

http://translate.google.com/translate?hl=en&sl=zh-CN&u=http://blog.csdn.net/masterz/archive/2011/03/08/6232585.aspx&ei=rzvUTankLM6dgQeVprEu&sa=X&oi=translate&ct=result&resnum=2&ved=0CCMQ7gEwAQ&prev=/search%3Fq%3Derror%2BC2664:%2B%27PyUnicodeUCS2_AsWideChar%27%2B:%2Bcannot%2Bconvert%2Bparameter%2B1%2Bfrom%2BPyUnicodeObject%2Bto%2BPyObject%26hl%3Den%26prmd%3Divns

I made all of those edits except adding

: <python-debugging> Off <define> BOOST_ALL_NO_LIB = 1 

to my user-config.jam because it caused an error during building and I couldn’t figure out what it was for (another suspect for my problems). After that , everything(?) built fine. Now when I do my hello world project, i get a few errors associated with not linking things properly and not being able to find the appropriate .lib file. (see attachment boost_error_old if interested) I google some more. I find this thread

http://comments.gmane.org/gmane.comp.lib.boost.user/67879

I follow these directions and make sure I have built the non static libraries which solves the previous error after I update my linking appropriately. So, now I get a new error which is the same error which the changes in the blog post written in chinese were supposed to prevent!? Any thoughts?

Here, you can see the commands I used to build my boost python libs (i just replaced them in the command line after it had finished), the chunk of code which I edited as per the blog post, as well as the errors I received when trying to build.

also, my MSVC solution Active config is Release|x64

Attachments


more clues…

LuxRender building requires boost.python. This video is for linux users but it has some of the same edits to the boost python source. 17:00-20:00 when this user is configuring boost is the relevant part. They use boost 1.43…that might be my next attempt.

I’m completely editing this post to make it more clear and to add screen shots.

-I downloaded boost 1.43.0, unpacked as before
-edited builtin_converters.cpp as before (line 434) (highlighted in MSVC 2008 window in screenshot)
-then built the boost python library with the bjam invocation (see the cmd prompt overlaid on top of MSVC 2008 project for my settings)
-changed the appropriate include and linker directories to point toward the 1.43.0 libraries
-changed the “Configuration Type” of my project to “Dynamic Library”
-built the DLL successfully for my hello world
http://dl.dropbox.com/u/2586482/boost_build_success.png

-In Python

import hello_ext

doesn’t work. How do I alert python to the fact that I have spent all this trouble wrapping this C++ code and now want to import my module?