[Rock-dev] Component not linking external library

Sylvain Joyeux bir.sylvain at gmail.com
Thu Apr 17 16:59:12 CEST 2014


So ...

You have to install the .so from the vendor's library. The best place to do
this is IMO from within your library's CMake code.

NEVER hardcode full path within cmake. CMake has a bunch of variables to
point to various places in the CMake project (e.g.
 CMAKE_CURRENT_SOURCE_DIR, CMAKE_PROJECT_DIR, ...)

As to your problem: you declare the method as inline but never give its
definition in the header file. Just remove the "inline" keyword.

Finally, I can only recommend that you follow Rock's guidelines as to
package naming, library naming and repository naming. Consistency always
helps.
   http://rock-robotics.org/documentation/packages/package_structure.html
   http://rock.opendfki.de/wiki/WikiStart/Standards/RG4
(they are all accessible from
http://rock.opendfki.de/wiki/WikiStart/Standards/)

Sylvain

PS: your use of static variables in your class as well as of hardcoded
project-specific values looks very suspicious to me :P
PPS: don't commit backup files (files ending with ~) in git


On Thu, Apr 17, 2014 at 4:00 PM, Eduardo Elael <eduardo.elael at tenkel.com>wrote:

> Now it's up to date. I haven't commited the changes, sorry.
> It's all there (on github) now.
>
> Eduardo Elael
>
> Coppetec/LEAD
>
>
> On Thu, Apr 17, 2014 at 2:47 AM, Sylvain Joyeux <bir.sylvain at gmail.com>wrote:
>
>> Hi Eduardo
>>
>> Your ethernet driver library is empty (at least on github), so where is
>> the EthernetDrivers::GPIOin_Driver class supposed to come from ? Is that
>> coming with the device's library ? If it is the case, consider creating a
>> custom handler in your autoproj package set that installs it and generates
>> a pkg-config file. You can have a look for instance at how the drivers/aria
>> package is handled in remotes/rock/libs.autobuild.
>>
>> I would also recommend that you follow Rock's guidelines on naming ...
>> consistency usually helps
>>
>> http://rock-robotics.org/stable/documentation/packages/package_structure.html
>>   http://rock.opendfki.de/wiki/WikiStart/Standards/RG4
>>
>> Sylvain
>>
>>
>>  On Wed, Apr 16, 2014 at 7:43 PM, Eduardo Elael <eduardo.elael at tenkel.com
>> > wrote:
>>
>>>  Hello,
>>>
>>> I'm using an ethernet based device which has it's own library ( a header
>>> ".h" and a external library ".so" ). When I created my rock library I added
>>> two lines to my Cmakelist: "HEADERS the_lib.h" and "LIBS
>>> /the/path/the_lib86x64.so". Doing that it compiled fine (through amake).
>>>
>>> Then, when I try to create a rock-component using this rock-library the
>>> amake returns errors showing "undefined reference"'s to functions
>>> implemented in the "the_lib86x64.so".
>>>
>>> So I tried copying the "the_lib86x64.so" to Rock/install/lib, I don't
>>> know if it's the correct way, but now I get the error:
>>>
>>> "Linking CXX executable orogen_default_inductive__Task
>>>     tasks/libinductive-tasks-gnulinux.so: undefined reference to
>>> `EthernetDrivers::GPIOin_Driver::read(bool*)' "
>>>
>>> Where "inductive" is my component name, and
>>> "EthernetDrivers::GPIOin_Driver::read(bool*)" is a method from a class
>>> defined in my rock-library.
>>>
>>> The actual state of my code:
>>>
>>> rock-library:
>>> https://github.com/OpenLEAD/EthernetDriver
>>>
>>> rock-component:
>>> https://github.com/OpenLEAD/InductiveS
>>>
>>> Thanks in advance,
>>> Eduardo Elael
>>>
>>> Coppetec/LEAD
>>>
>>> _______________________________________________
>>> Rock-dev mailing list
>>> Rock-dev at dfki.de
>>> http://www.dfki.de/mailman/cgi-bin/listinfo/rock-dev
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.dfki.de/pipermail/rock-dev/attachments/20140417/9fc9c6b7/attachment.htm 


More information about the Rock-dev mailing list