Linking with soem_beckhoff_drivers

Hi,

I have a component that uses the AnalogMsg type of the soem beckhoff
drivers:
in my component:
#include <soem_beckhoff_drivers/AnalogMsg.h>

But this gives a linking error:
/usr/bin/ld: cannot find -lrtt-soem_beckhoff_drivers-typekit
/usr/bin/ld: cannot find -lrtt-soem_beckhoff_drivers-ros-transport
/usr/bin/ld: cannot find -lsoem_el1xxx
/usr/bin/ld: cannot find -lsoem_el2xxx
/usr/bin/ld: cannot find -lsoem_el4xxx
/usr/bin/ld: cannot find -lsoem_el3102
/usr/bin/ld: cannot find -lsoem_el5101
/usr/bin/ld: cannot find -lsoem_el6022
/usr/bin/ld: cannot find -lsoem_el30xx
/usr/bin/ld: cannot find -lsoem_el3104
collect2: error: ld returned 1 exit status

So I tried to target link to the library:
in my CMakeLists.txt
find_package(catkin REQUIRED COMPONENTS soem_beckhoff_drivers)
target_link_libraries(my_component ${catkin_LIBRARIES}
${USE_OROCOS_LIBRARIES})

But this gives me this problem:
CMake Error at
/opt/ros/indigo/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake:300
(target_link_libraries):
Target "soem_el3104" of type UTILITY may not be linked into another
target.
One may link only to STATIC or SHARED libraries, or to executables
with the
ENABLE_EXPORTS property set.
Call Stack (most recent call first):
frs_lasers/src/CMakeLists.txt:17 (orocos_component)

Any hints how to solve this in a Catkinized world?

Thanks!

Nick

Linking with soem_beckhoff_drivers

Hi,

On 12/22/2015 12:03 PM, Dominick Vanthienen wrote:
> Hi,
>
> I have a component that uses the AnalogMsg type of the soem beckhoff
> drivers:
> in my component:
> #include <soem_beckhoff_drivers/AnalogMsg.h>
>
> But this gives a linking error:
> /usr/bin/ld: cannot find -lrtt-soem_beckhoff_drivers-typekit
> /usr/bin/ld: cannot find -lrtt-soem_beckhoff_drivers-ros-transport
> /usr/bin/ld: cannot find -lsoem_el1xxx
> /usr/bin/ld: cannot find -lsoem_el2xxx
> /usr/bin/ld: cannot find -lsoem_el4xxx
> /usr/bin/ld: cannot find -lsoem_el3102
> /usr/bin/ld: cannot find -lsoem_el5101
> /usr/bin/ld: cannot find -lsoem_el6022
> /usr/bin/ld: cannot find -lsoem_el30xx
> /usr/bin/ld: cannot find -lsoem_el3104
> collect2: error: ld returned 1 exit status
>
> So I tried to target link to the library:
> in my CMakeLists.txt
> find_package(catkin REQUIRED COMPONENTS soem_beckhoff_drivers)
> target_link_libraries(my_component ${catkin_LIBRARIES}
> ${USE_OROCOS_LIBRARIES})
>
> But this gives me this problem:
> CMake Error at
> /opt/ros/indigo/lib/cmake/orocos-rtt/UseOROCOS-RTT.cmake:300
> (target_link_libraries):
> Target "soem_el3104" of type UTILITY may not be linked into another
> target.
> One may link only to STATIC or SHARED libraries, or to executables
> with the
> ENABLE_EXPORTS property set.
> Call Stack (most recent call first):
> frs_lasers/src/CMakeLists.txt:17 (orocos_component)
>
> Any hints how to solve this in a Catkinized world?
I get this CMake error actually already once I add
<build_depend>soem_beckhoff_drivers</build_depend>
to my CMakeLists.txt and try to compile.
The line where the error occurs, is the orocos_component(...) macro,
even when the component that is compiled does not have any dependency on
the soem_beckhoff_drivers.

I was able to compile the whole after removing all references to
soem_beckhoff_drivers in my CMakeLists.txt and package.xml.
However, since one of the components in my package does include a header
from the soem_beckhoff_drivers package,
shouldn't I somehow tell my package where to look for them or at least
notify users that this dependency does exist?
How should I do this then?
>
> Thanks!
>
> Nick
>