Dear developers & friends,
I'm making a component which uses the ZDB library ( a connection database pool : http://code.google.com/p/libzdb/ ) and it's compile successfully but the linking process has problem with it. I write different tags on CMakeList.txt
in order to be sure that the Linker has a reference of the installed library (zdb).
link_directories(/usr/local/lib) find_library(ZDB_LIB zdb) if ("${ZDB_LIB}" STREQUAL "ZDB_LIB-NOTFOUND") message(FATAL_ERROR "'zdb' wasn't found!") else() message("'zdb' found: " ${ZDB_LIB}) endif () ... orocos_use_package(${ZDB_LIB}) orocos_use_package(zdb) ... target_link_libraries(mysqlDB ${ZDB_LIB})
But it's appear something wrong, because the linker not found the referenced objects from the ZDB library. (and it's exists and has been compiled and linked in a generic C++ project [not orocos]).
mysqlDB-component.cpp:(.text+0x493): undefined reference to `URL_new(char const*)' mysqlDB-component.cpp:(.text+0x4a1): undefined reference to `ConnectionPool_new(URL_S*)' mysqlDB-component.cpp:(.text+0x4bb): undefined reference to `ConnectionPool_start(ConnectionPool_S*)'
Somebody knows if I need any different tag? I put VERBOSE=2
and the result has been:
antonio_castellon@WS-02:/orocos/projects/mysqlDB$ make Makefile:7: This Makefile builds this package with default settings mkdir -p build cd build ; cmake .. -DINSTALL_PATH=orocos && make Re-run cmake no build system arguments Orocos-RTT found in /orocos/install/lib/cmake/orocos-rtt/orocos-rtt-gnulinux-libraries.cmake -- Found orocos-rtt 2.4.0 for the gnulinux target. Available transports: corba mqueue -- - Found requested orocos-rtt components: rtt-marshalling rtt-scripting [UseOrocos] Building package mysqlDB 'zdb' found: /usr/local/lib/libzdb.so [UseOrocos] Linking all targets with libraries from package 'ocl-logging'. [UseOrocos] Linking all targets with libraries from package 'log4cpp'. -- checking for one of the modules '/usr/local/lib/libzdb.so;/usr/local/lib/libzdb.so-gnulinux' -- checking for one of the modules 'zdb;zdb-gnulinux' [UseOrocos] Building component mysqlDB in library mysqlDB-gnulinux [UseOrocos] Generating package version 1.0 (default version). -- Configuring done -- Generating done -- Build files have been written to: /orocos/projects/mysqlDB/build make[1]: Entering directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' /usr/bin/cmake -H/orocos/projects/mysqlDB -B/orocos/projects/mysqlDB/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /orocos/projects/mysqlDB/build/CMakeFiles /orocos/projects/mysqlDB/build/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[2]: Entering directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' make -f CMakeFiles/mysqlDB.dir/build.make CMakeFiles/mysqlDB.dir/depend make[3]: Entering directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' cd /orocos/projects/mysqlDB/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /orocos/projects/mysqlDB /orocos/projects/mysqlDB /orocos/projects/mysqlDB/build /orocos/projects/mysqlDB/build /orocos/projects/mysqlDB/build/CMakeFiles/mysqlDB.dir/DependInfo.cmake --color= make[3]: Leaving directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' make -f CMakeFiles/mysqlDB.dir/build.make CMakeFiles/mysqlDB.dir/build make[3]: Entering directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' Linking CXX shared library libmysqlDB-gnulinux.so /usr/bin/cmake -E cmake_link_script CMakeFiles/mysqlDB.dir/link.txt --verbose=2 /usr/bin/c++ -fPIC -Wl,-z,defs -shared -Wl,-soname,libmysqlDB-gnulinux.so -o libmysqlDB-gnulinux.so CMakeFiles/mysqlDB.dir/src/com/digital/services/mysqlDB-component.cpp.o CMakeFiles/mysqlDB.dir/src/com/digital/services/mysqlDB-macros.cpp.o -L/usr/local/lib /orocos/install/lib/liborocos-ocl-log4cpp-gnulinux.so /media/DATA/orocos-toolchain/install/lib/orocos/gnulinux/ocl/liborocos-ocl-logging-gnulinux.so /media/DATA/orocos-toolchain/install/lib/orocos/gnulinux/ocl/liborocos-ocl-log4cxx-gnulinux.so /orocos/install/lib/liborocos-rtt-gnulinux.so -lpthread -lrt /usr/local/lib/liblog4cpp.so -lnsl /orocos/install/lib/liborocos-rtt-gnulinux.so.2.4.0 /usr/local/lib/libzdb.so /orocos/install/lib/orocos/gnulinux/plugins/librtt-marshalling-gnulinux.so /orocos/install/lib/orocos/gnulinux/plugins/librtt-scripting-gnulinux.so -lboost_filesystem-mt -lboost_system-mt -lboost_serialization-mt -lpthread -lrt -ldl -Wl,-rpath,/usr/local/lib:/orocos/install/lib:/media/DATA/orocos-toolchain/install/lib/orocos/gnulinux/ocl:/orocos/install/lib/orocos/gnulinux/plugins:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: CMakeFiles/mysqlDB.dir/src/com/digital/services/mysqlDB-component.cpp.o: In function `emperocd::services::mysqlDB::configureHook()': mysqlDB-component.cpp:(.text+0x493): undefined reference to `URL_new(char const*)' mysqlDB-component.cpp:(.text+0x4a1): undefined reference to `ConnectionPool_new(URL_S*)' mysqlDB-component.cpp:(.text+0x4bb): undefined reference to `ConnectionPool_start(ConnectionPool_S*)' collect2: ld returned 1 exit status make[3]: *** [libmysqlDB-gnulinux.so] Error 1 make[3]: Leaving directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' make[2]: *** [CMakeFiles/mysqlDB.dir/all] Error 2 make[2]: Leaving directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' make[1]: *** [all] Error 2 make[1]: Leaving directory `/media/DATA/orocos-toolchain.2.4.0/projects/mysqlDB/build' make: *** [all] Error 2
Thanks in advance & best regards for all, Orocos is a great framework¡ Toni
undefined reference from linker process
On Fri, 28 Oct 2011, antonio [dot] castellon [..] ... wrote:
> Dear developers & friends, I'm making a component which uses the ZDB library
> ( a connection database pool : http://code.google.com/p/libzdb/ ) and it's
> compile successfully but the linking process has problem with it.
I would really advise _not_ to use RTT components for doing this kind of
"administrative ICT" stuff! Use whatever works in that world, and
communicate with the (realtime) Orocos components via some middleware.
You seem to suffer from the "I now have this Orocos hammer so every ICT
task I encounter becomes an RTT nail"... :-) Use the right tools for the
right job, and learn how to combine them.
Best regards,
Herman Bruyninckx
> I write
> different tags on
undefined reference from linker process
Hi Herman,
Thanks for your point of view, and I think the same as you (for me RTT
Orocos is not a bulletproof, it is a one of the tools to be used
correctly).
My project is not a website project, is a robot development which it needs
a connection with the database to store/read some data. This data is stored
from several RTT components usign a correct queue between Non-RTT O.C.
(Orocos Component) and the rest of RTT.O.C. The Non-RTT O.C. has a
low-priority assigned and has the connection access to the database (using
ZDB).
I understand that is possible to have bottle neck problems on the Queue
(depending of the numbers of queries from RTT) but at the moment I want to
test it to evaluate the pros and cons.
In the other hand, how do you serialize and query data from RTT?, I
understand that for deterministic reasons it is implemented using the
memory allocation to be more fast. But, at the same point that log4cpp, you
need store some data from RTT O.C. in some repositories, and later send
queries from another components or external non-orocos processes.
Note: ICT: Information and Communication Technology
Thanks in advance,
Toni
On Fri, Oct 28, 2011 at 08:11, Herman Bruyninckx <
Herman [dot] Bruyninckx [..] ...> wrote:
> On Fri, 28 Oct 2011, antonio [dot] castellon [..] ... wrote:
>
> Dear developers & friends, I'm making a component which uses the ZDB
>> library
>> ( a connection database pool : http://code.google.com/p/**libzdb/<http://code.google.com/p/libzdb />) and it's
>> compile successfully but the linking process has problem with it.
>>
>
> I would really advise _not_ to use RTT components for doing this kind of
> "administrative ICT" stuff! Use whatever works in that world, and
> communicate with the (realtime) Orocos components via some middleware.
>
> You seem to suffer from the "I now have this Orocos hammer so every ICT
> task I encounter becomes an RTT nail"... :-) Use the right tools for the
> right job, and learn how to combine them.
>
> Best regards,
>
> Herman Bruyninckx
>
> I write
>> different tags on