ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2012-04-24 18:08:38 -0500

joq gravatar image

This is probably not complete:

First, add <rosdep name="libmysqlclient-dev"/> to your manifest.xml.

Reference the file in your C++ sources using: #include <mysql/mysql.h>

Add something like this to your CmakeLists.txt:

find_package(MySql REQUIRED)
include_directories(${MYSQL_INCLUDE_DIRS})
add_definitions(${MYSQL_DEFINITIONS})

Please post corrections if this is not quite right.

This is probably not complete:

First, add <rosdep name="libmysqlclient-dev"/> to your manifest.xml.

Reference the file in your C++ sources using: #include <mysql/mysql.h>

Add something like this to your CmakeLists.txt:

find_package(MySql REQUIRED)
include_directories(${MYSQL_INCLUDE_DIRS})
add_definitions(${MYSQL_DEFINITIONS})

Please post corrections if this is not quite right.UPDATE: a library that depends on MySQL probably needs to export some link flags in its manifest.xml like this:

<export>
  <cpp lflags="-lmysqlclient"/>
</export>

Normally, that would be done using pkg-config, but I don't see a .pc file for MySQL on Ubuntu Oneiric. You may have to figure out the correct lflags experimentally.

click to hide/show revision 3
make answer less uncertain

This is probably may not be complete:

First, add <rosdep name="libmysqlclient-dev"/> to your manifest.xml.

Reference the file in your C++ sources using: #include <mysql/mysql.h>

Add something like this to your CmakeLists.txt:

find_package(MySql REQUIRED)
include_directories(${MYSQL_INCLUDE_DIRS})
add_definitions(${MYSQL_DEFINITIONS})

UPDATE: a library that depends on MySQL probably needs to export some link flags in its manifest.xml like this:

<export>
  <cpp lflags="-lmysqlclient"/>
</export>

Normally, that would be done using pkg-config, but I don't see a .pc file for MySQL on Ubuntu Oneiric. You may have to figure out the correct lflags experimentally.