[C++-sig] Embedding...

Beau Sapach beau.sapach at ualberta.ca
Thu Oct 26 18:27:09 CEST 2006


That seems to have worked, I manually added the BOOST_PYTHON_DECL macro to
the 4 files and now it links just fine.  Thanks!  Strangely though, my app
can't link into the DLL at runtime unless it's in the same folder, even
though the DLL is on the PATH and the LD_LIBRARY_PATH.  And finally, the
program is breaking within the first call to import:

boost::python::object main = boost::python::import("__main__");

it breaks on:

python::handle<> module(python::borrowed(PyImport_AddModule(n)));

saying:

Unhandled exception at 0x1e079547 in boostapp.exe: 0xC0000005: Access
violation reading location 0x00000004.

Beau

-----Original Message-----
From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org] On
Behalf Of Stefan Seefeld
Sent: Wednesday, October 25, 2006 5:41 PM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] Embedding...

Beau Sapach wrote:

[...]

> I'm not sure if this means that it compiled and linked properly but I 
> certainly don't see any errors...
> What is libboost_python.lib for?

OK, so it gets compiled into the library. However, I just realize that these
symbols don't get exported by a dll (by default) on windows, so a declspec
decorator is missing.
(I'm rarely using windows, so I haven't noticed this omission yet.)

Could you please try the attached patch to see whether it solves the missing
symbols issue ?

(If you don't know how to apply a patch: please try injecting the
BOOST_PYTHON_DECL macro at the four different places as shown in the applied
patch file.)


Many thanks,
		Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...




More information about the Cplusplus-sig mailing list