
Hello. I downloaded boost.extensions from http://boost-extension.blogspot.com/?gclid=CNjp5dfJ2JUCFQsZQgod0mHbWg When I tried the first example (the shared_library one) in the tutorial, I realized that the macro BOOST_EXTENSION_EXPORT_DECL didn't prevent c++ name mangling for the example function. I had to add extern "C" before void manually. And in the second tutorial (the animals tutorial) BOOST_EXTENSION_TYPE_MAP_FUNCTION seems to be called, but when I get the map from main, it is empty. The library is found (LD_LIBRARY_PATH is set so that it finds the library) but it does not work. Thank you. Tested in gcc 4.2.3 under ubuntu 8.04.

German,
Hmm, I've tried it with a couple of versions of GCC on Ubuntu (not yet
4.2.3), and can't reproduce the errors you mention.
Could you describe the exact sequence of bjam and other commands (are you
using bjam?) that you use (and which directories you use them in) to
reproduce the problem?
Also, could you try running the following script in the root of the
extracted directory? (ie, extension-reflection/)
You'll need to define BOOST_BJAM_LOCATION if bjam isn't in your path, and
you may need to define BOOST_BJAM_OPTIONS. If you don't have bjam, I've
included the source in tools/jam/src/.
# BEGIN BASH SCRIPT
set -e
set -x
echo Testing
if [ -z $BOOST_BJAM_LOCATION ]
then
BOOST_BJAM_LOCATION=bjam
fi
BOOST_SANDBOX_ROOT=`pwd`
BOOST_ROOT=`pwd`
BOOST_BUILD_PATH=${BOOST_ROOT}/tools/build/v2
for f in libs/extension/examples libs/reflection/examples
libs/reflection/test libs/extension/test
do
cd $BOOST_ROOT/$f
echo `pwd`
$BOOST_BJAM_LOCATION $BOOST_BJAM_OPTIONS
done
# END BASH SCRIPT
Thanks for the bug reports.
Jeremy Pack
On Sat, Sep 13, 2008 at 5:24 AM, Germán Diago
Hello. I downloaded boost.extensions from http://boost-extension.blogspot.com/?gclid=CNjp5dfJ2JUCFQsZQgod0mHbWg
When I tried the first example (the shared_library one) in the tutorial, I realized that the macro BOOST_EXTENSION_EXPORT_DECL didn't prevent c++ name mangling for the example function. I had to add extern "C" before void manually.
And in the second tutorial (the animals tutorial) BOOST_EXTENSION_TYPE_MAP_FUNCTION seems to be called, but when I get the map from main, it is empty. The library is found (LD_LIBRARY_PATH is set so that it finds the library) but it does not work. Thank you.
Tested in gcc 4.2.3 under ubuntu 8.04. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Now I don't have the same machine available til thrusday to test the script, but I'll do whenever I have some time. Anyway, I compiled my library by hand using this command: g++ -fPIC -shared myfile.o -o myfile.extension and the program with: g++ myprogram.cpp -o myprogram The problem was related to the types_map. It seems as if the instance passed to the shared library weren't the same of the executable. I remember I had some kind of problem similar to that implementing a singleton. Whenever I can I'll try the script. Thanks.

German,
comments below
On Mon, Sep 15, 2008 at 11:10 AM, Germán Diago
Now I don't have the same machine available til thrusday to test the script, but I'll do whenever I have some time. Anyway, I compiled my library by hand using this command:
g++ -fPIC -shared myfile.o -o myfile.extension
and the program with:
g++ myprogram.cpp -o myprogram
My recommendation is to use bjam to build, but have it output the build commands that it uses ("bjam -d+2" is the command line, I think). Then use those g++ commands in your own build.
<snip>
Jeremy Pack
participants (2)
-
Germán Diago
-
Jeremy Pack