[Rock-dev] modbus library
Martin Zenzes
martin.zenzes at dfki.de
Mon Apr 27 17:09:04 CEST 2015
Hi,
looks like your code in ".../rock/install/lib/libbase_modbus.so" calls
functions not present in the "/usr/lib/x86_64-linux-gnu/libmodbus.so".
You can use "apt-cache policy libmodbus" to check which versions of
libmodbus are available, look up its documentation and adopt your api
accordingly. You can also use "objdump" on both to looks whats actually
there. Maybe cmake picks up a wrong "libmodbus.so" prior to linking to
the installed one, here the "LD_DEBUG" environment variable comes in handy.
Having an english locale will results in english-language error
messages, which are verbatim google search phrases. At least from time
to time ,-)
Hope something of this might help. Good luck ;-)
Martin
On 04/27/2015 04:17 PM, fahrlich wrote:
> Hi
>
> i wrote a modbus driver that depends on linux-modbus library .
>
> The driver is called base_modbus and i added a FindModbus.cmake file
> to the project
> and following lines to the CMakeList.txt in the src folder:
>
> set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
> "${CMAKE_SOURCE_DIR}/cmake/Modules/")
> rock_find_cmake(modbus)
> include_directories(${modbus})
>
> So far , this works fine .
>
> Then i wrote another driver, called irdh_bender, that inherits from
> base_modbus.
> I did the same stuff as described above: put the findModbus.cmake
> script into the the project folder and
> adapted the CMakeLists.txt
>
> This works fine, too
>
> Then i wrote a task, to run the irdh_bender lib. Again, i put the
> findmodbus.cmake file into project folder.
> Into CmakeLists.txt i added:
>
>
> list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
> message(STATUS " cmake module path : ${CMAKE_MODULE_PATH}")
>
> FIND_PACKAGE(Modbus REQUIRED)
> list(APPEND EXTRA_LIBS modbus)
>
> include_directories(${MODBUS_INCLUDE_DIR})
> message(STATUS "cmake module path : ${MODBUS_INCLUDE_DIR}")
>
>
>
> But if i run amake i get following linking error
>
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_new_tcp_pi'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_read_input_registers'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_flush'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_close'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_set_debug'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_free'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_connect'
> /home/fahrlich/code/rock/install/lib/libbase_modbus.so: Nicht
> definierter Verweis auf `modbus_strerror'
>
>
>
> But in rock/install/log/drivers/orogen/irdh_bender-configure.log ui can
> see that the lib was found :
>
>
> cmake module path :
> /home/fahrlich/code/rock/drivers/orogen/irdh_bender/.orogen/config;/home/fahrlich/code/rock/drivers/orogen/irdh_bender
> -- Found libmodbus: /usr/lib/x86_64-linux-gnu/libmodbus.so
> -- Found modbus include Dir: /usr/include/modbus
>
>
> How can i fix this ?
>
> thanks
> Frauke
> _______________________________________________
> Rock-dev mailing list
> Rock-dev at dfki.de
> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
--
M.Sc. Martin Zenzes
Space Robotics
Hauptgeschäftsstelle Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0) 421 178 45 - 6658
Fax: +49 (0) 421 178 45 - 4150
E-Mail: martin.zenzes at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
More information about the Rock-dev
mailing list