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

CMake with compiled matlab code

asked 2012-02-18 13:19:59 -0600

ttosun gravatar image

updated 2014-01-28 17:11:24 -0600

ngrennan gravatar image

Hello,

I'm trying to compile a ROS node that calls functions from a dynamic c++ library created using MatLab's mcc compiler. This requires me to compile against the library I wrote as well as the matlab mcl libraries which allow mcc'd libraries to be deployed.

The .so and .h files for the library I wrote are in my src folder, and appear to be linking to the node code correctly. However, I receive the error message "fatal error: mclmcrrt.h: No such file or directory" when running make.

mclmcrrt.h is the primary header file for mcc library deployment, located at /opt/matlab/extern/include/. How do I indicate to cmake that it can find the required files at this location?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-02-18 13:45:50 -0600

Thomas D gravatar image

Try adding the following line to your CMakeLists.txt file:

include_directories (/opt/matlab/extern/include)
edit flag offensive delete link more

Comments

Thanks! That worked.

ttosun gravatar image ttosun  ( 2012-02-19 10:44:26 -0600 )edit

Hi!Did this work?I want to do the same but my program crashes during runtime when calling mclInitializeApplication(NULL,0).I'm using MATLAB R2012b and fuerte. Any help would be immensely welcome as I'm really struggling with this http://answers.ros.org/question/59302/matlab-mrc-engine-and-ros/

Enrique Fernandez gravatar image Enrique Fernandez  ( 2013-03-27 05:20:50 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2012-02-18 13:19:59 -0600

Seen: 1,370 times

Last updated: Feb 18 '12