On 18. Sep, 2009, at 9:15, Christian Ehrlicher wrote:
Von: Michael Wild
On 18. Sep, 2009, at 8:14, Christian Ehrlicher wrote:
Hi,
I've an external project which made the decision to create an
executable which exports symbols. This means if you want to write a
plugin for this project you have to link your plugin against this
executable.
Now I've the problem that FIND_LIBRARY doesn't find this executable.
Does anybody knows a hack to be able to link against an executable
which is not built by the project?
I'm really lost here but I can't convince them to fix it... :(
Managing an own patch to work around this problem isn't a good long-
term perspective.
Thx,
Christian
find_program?
You're right - I did not know that TARGET_LINK_LIBRARIES accepts this.
If you pass a full path to TARGET_LINK_LIBRARIES, it doesn't too much
checking. I think it will do some basic checks that the file is valid
(there was a discussion on that some time ago), but otherwise just
passes the file on the link-line.
And that is a REALLY broken design (and AFAIK only works on Windows).
I'm currently investigating and think it doesn't work on linux at
all (which would be very good for me). I'm getting duplicate
symbols :)
-->
FIND_PROGRAM(STAGE_LIB STAGE PATHS /opt/3dviewer/bin)
ADD_LIBRARY(dummy SHARED dummy.cpp)
TARGET_LINK_LIBRARIES(dummy ${STAGE_LIB})
-->
/usr/local/bin/c++ -fPIC -g -shared -Wl,-soname,libdummy.so -o
libdummy.so CMakeFiles/dummy.dir/dummy.cpp.o /opt/3dviewer/bin/STAGE
/opt/3dviewer/bin/STAGE: In function `_fini':
/usr/src/packages/BUILD/glibc-2.9/cc-nptl/csu/crti.S:37: multiple
definition of `_fini'
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/crti.o:/usr/
src/packages/BUILD/glibc-2.9/cc-nptl/csu/crti.S:37: first defined here
/opt/3dviewer/bin/STAGE: In function `_init':
/usr/src/packages/BUILD/glibc-2.9/cc-nptl/csu/crti.S:25: multiple
definition of `_init'
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../lib64/crti.o:/usr/
src/packages/BUILD/glibc-2.9/cc-nptl/csu/crti.S:25: first defined here
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/
bin/ld: libdummy.so: version node not found for symbol vtable for
__cxxabiv1::__class_type_info@@CXXABI_1.3
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/
bin/ld: failed to set dynamic section sizes: Bad value
collect2: ld returned 1 exit status
-->
I should have tried this earlier :)
Thx,
Christian
Probably you CAN get around these multiple definitions error by using
a linker-script when building this STAGE program. The later errors are
more worrying...
Michael
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake