Hey <br><br>Yesterday I figured out how to use target_link_libraries to add libraries, but only one library at the time. A great thanks to Brian's CMake style approach, just what I seeked, also thanks to Rich for the links, nice with additional information of the use of CMake. <br>
<br>Regards<br><br>Sebastian<br><br><div class="gmail_quote">On 15 February 2011 05:11, Rich Mattes <span dir="ltr"><<a href="mailto:jpgr87@gmail.com">jpgr87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 02/14/2011 09:01 PM, Brian Gerkey wrote:<br>
> On Sun, Feb 13, 2011 at 11:46 AM, Aslund<<a href="mailto:sebastian.aslund@gmail.com">sebastian.aslund@gmail.com</a>>  wrote:<br>
>> While an option is to use the ROS Player driver, then I want to avoid it. I<br>
>> have already Player installed on my robot and had quite some problems with<br>
>> it, which is now solved, but it scared me from doing any changes to it, so I<br>
>> want to maintain the robot as it is.<br>
>> My idea is to have a second computer to process the algorithms, which<br>
>> communicates through Player on a local network to my robot.<br>
>> I used the Publisher example from the tutorial to create a base to work<br>
>> with, if I add the following lines to my CMakeLists.txt:<br>
>><br>
>> include_directories(/usr/local/include/player-3.1)<br>
>> link_directories(/usr/local/lib)<br>
>><br>
>> then I am able to compile the example including the header file of Player (<br>
>> #include "libplayerc++/playerc++.h" ), but when I add Player functions, then<br>
>> rosmake returns that there are undefined references, which could indicate<br>
>> that I need a way of adding the library files into my CMakeLists.txt list.<br>
>> My problem is that I do not know how to add  .so-library files into<br>
>> CMakeLists.txt inorder to make the compiler able to use Player functions, I<br>
>> hope someone can help me resolving this problem.<br>
> I would use pkg-config to get the build flags for Player.  Assuming<br>
> that you're trying to build a client program against libplayerc++, do<br>
> something like:<br>
><br>
> include(FindPkgConfig)<br>
> pkg_check_modules(PLAYERCPP REQUIRED playerc++)<br>
> include_directories(${PLAYERCPP_INCLUDE_DIRS})<br>
> link_directories(${PLAYERCPP_LIBRARY_DIRS})<br>
> # Assuming that you're building an executable named foo<br>
> target_link_libraries(foo ${PLAYERCPP_LIBRARIES})<br>
><br>
> Note that you may have to add /usr/local/lib/pkgconfig to your PKG_CONFIG_PATH.<br>
><br>
>       brian.<br>
><br>
<br>
</div></div>If you're using cmake, you may also find the following helpful:<br>
<br>
<a href="http://playerstage.sourceforge.net/wiki/Player_and_CMake" target="_blank">http://playerstage.sourceforge.net/wiki/Player_and_CMake</a><br>
<a href="http://playerstage.sourceforge.net/wiki/Compiling_Player_3_clients_and_plugins" target="_blank">http://playerstage.sourceforge.net/wiki/Compiling_Player_3_clients_and_plugins</a><br>
<font color="#888888"><br>
Rich<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</div></div></blockquote></div><br>