help linking to python for dbus-python bindings

Simon McVittie simon.mcvittie at
Wed Jul 4 04:29:26 PDT 2012

On 04/07/12 01:44, Mark Mikofski wrote:
> I have passed PYTHON_LIBS="-L/c/python27/libs -llibpython27.a" with and
> without the "a" extension.

The right syntax for -l (at least on Unix...) looks like "-lpython27".
You shouldn't specify the "lib" at the beginning, or the extension (.a,
.dll, .lib) at the end - the compiler should add those automatically.

If you have libraries visible to your compiler in
/c/python27/libs/libpython27.a, /c/python27/libs/libpython27.lib and/or
/c/python27/libs/libpython27.dll (probably easiest to copy them all into
the same directory?) then the correct value for PYTHON_LIBS would be:

    PYTHON_LIBS="-L/c/python27/libs -lpython27"

Please try this patched version of the dbus-python source, which should
hopefully improve matters on Windows:

or get the 'wip-windows' branch from the dbus-python git repository
(it's the same code). Let me know if this works better, I'll merge it if
there's positive feedback.

> I also made my own library from python27.dll using the directions on
> mingw faqs [1], then linking using PYTHON_LIBS="-L/mingw/lib
> -libpython27" which is where I copied the library too, both with and
> without the "a" extension.

When reporting a bug or asking for help, a good format is:

* what you did (in enough detail that someone else could do exactly the
same - so in this case, please include the exact configure and make
commands you used)

* what you expected to happen (presumably "a _dbus_bindings.pyd that I
can import" in this case)

* what actually happened, including the exact text of any error messages


More information about the dbus mailing list