--- Begin Message ---
Subject: |
c++ dlopen plugin --> returns undefined symbol |
Date: |
Fri, 06 Jul 2007 16:02:15 +0200 |
User-agent: |
KNode/0.10.4 |
Hi
I'm trying to run the C++ dlopen example from
http://www.linux.org/docs/ldp/howto/C++-dlopen/thesolution.html.
but I always get the error message
"Cannot load library: .libs/libtriangle.so: undefined symbol: _ZTI7Polygon"
I see that the compiler renames the >Polygon< class, the >Polygon< class is
defined in a header file and included in main-program and plugin-lib. But
it seems that the compiler creates different symbol names each time.
The compile lines attached below.
thx in advance Thomas
-- build of main program --
cd '<cpp-dlopentest>/debug/./src' && WANT_AUTOCONF_2_5="1"
WANT_AUTOMAKE_1_6="1" make -j2 cpp_dlopentest
if g++ -DHAVE_CONFIG_H -I. -I<cpp-dlopentest>/src -I.. -O0 -g3 -MT
cpp_dlopentest.o -MD -MP -MF ".deps/cpp_dlopentest.Tpo" -c -o
cpp_dlopentest.o <cpp-dlopentest>/src/cpp_dlopentest.cpp; then
mv -f ".deps/cpp_dlopentest.Tpo" ".deps/cpp_dlopentest.Po"; else
rm -f ".deps/cpp_dlopentest.Tpo"; exit 1; fi
/bin/sh ../libtool --tag=CXX --mode=link g++ -O0 -g3 -o cpp_dlopentest -ldl
cpp_dlopentest.o
mkdir .libs
g++ -O0 -g3 -o cpp_dlopentest cpp_dlopentest.o -ldl
-- END --
-- build of libtriangle.so --
cd '<cpp-dlopentest>/debug/./src' && WANT_AUTOCONF_2_5="1"
WANT_AUTOMAKE_1_6="1" make -j2 libtriangle.la
if /bin/sh ../libtool --tag=CXX --mode=compile
g++ -DHAVE_CONFIG_H -I. -I<cpp-dlopentest>/src -I.. -fPIC -O0 -g3 -MT
libtriangle_la-triangle.lo -MD -MP -MF ".deps/libtriangle_la-triangle.Tpo" -c -o
libtriangle_la-triangle.lo `test -f 'triangle.cpp' ||
echo '<cpp-dlopentest>/src/'`triangle.cpp; then
mv -f ".deps/libtriangle_la-triangle.Tpo" ".deps/libtriangle_la-triangle.Plo";
else rm -f ".deps/libtriangle_la-triangle.Tpo"; exit 1; fi
mkdir .libs
g++ -DHAVE_CONFIG_H -I. -I<cpp-dlopentest>/src -I.. -fPIC -O0 -g3 -MT
libtriangle_la-triangle.lo -MD -MP -MF .deps/libtriangle_la-triangle.Tpo -c
<cpp-dlopentest>/src/triangle.cpp -fPIC -DPIC -o
.libs/libtriangle_la-triangle.o
<cpp-dlopentest>/src/triangle.cpp:36:2: warning: no newline at end of file
g++ -DHAVE_CONFIG_H -I. -I<cpp-dlopentest>/src -I.. -fPIC -O0 -g3 -MT
libtriangle_la-triangle.lo -MD -MP -MF .deps/libtriangle_la-triangle.Tpo -c
<cpp-dlopentest>/src/triangle.cpp -o libtriangle_la-triangle.o >/dev/null
2>&1
/bin/sh ../libtool --tag=CXX --mode=link g++ -O0 -g3 -o
libtriangle.la -rpath /usr/local/lib -module -shared
libtriangle_la-triangle.lo
g++ -shared -nostdlib
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/crtbeginS.o .libs/libtriangle_la-triangle.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2
-L/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -lstdc++ -lm -lc -lgcc_s
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/crtn.o -Wl,-soname
-Wl,libtriangle.so.0 -o .libs/libtriangle.so.0.0.0
(cd .libs && rm -f libtriangle.so.0 && ln -s libtriangle.so.0.0.0
libtriangle.so.0)
(cd .libs && rm -f libtriangle.so && ln -s libtriangle.so.0.0.0
libtriangle.so)
-- END ---
--- End Message ---
--- Begin Message ---
Subject: |
confirm e5502e26edfdf840ea3bff2b12e02a6efd1fd0d4 |
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message. Do this if the message is
spam. If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list. The Approved: header can also appear in the first line
of the body of the reply.
--- End Message ---