Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-03-05 00:00:34


Shin <shin_at_[hidden]> writes:

> So, I don't know if folks in the Boost.Python community are aware, but the
> game Civilization 4 makes use of Python as its primary in-game
> scripting/modding language.

We know; http://www.boost.org/libs/python/doc/projects.html

> The Python scripts interact with the Civ4
> engine via Boost.Python (1.32 I believe). Up until a month ago, I hadn't
> really used Python, and I'd never heard of Boost.Python :/. As part of my
> learning experience, I've been learning more about the tools available in
> this space. My current point in this process is trying to get PyDev and
> Eclipse configured to allow me to edit Civ4 mods. In pursuit of that goal,
> I've been talking with Fabio Zadrozny over on the PyDev site about
> configuring PyDev. He's been very helpful, but I've hit a snag for which
> he doesn't recall the issue and has sent me here in hopes that someone here
> might be able to help.
>
> I have Python (2.2, 2.3 and 2.4 ;), installed on my machine. I've managed
> to build Boost.Python 1.32 static and dynamic libs, and have that dir in my
> path. I know that Civ4's Python API objects are stored in a file called
> CvGameCoreDLL.dll. When I try to import it from the command line I get the
> following error:
>
> ImportError: dynamic module does not define init function (initCvGameCoreDLL)

You're missing

       BOOST_PYTHON_MODULE(CvGameCoreDLL)

or you've failed to build with the appropriate options. I suggest you
follow the build instructions for your module at
http://www.boost.org/libs/python/doc/building.html#building_ext

If you add -n -a to the bjam command-line it will just print the build
commands so you can look at the options if you prefer.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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