【发布时间】:2016-12-07 16:27:33
【问题描述】:
我一直在尝试使用 Matlab 编译器 SDK 将我的 Matlab 程序打包为 Debian 系统中的 C++ 共享库。我得到了包括test.c、test.h、test.so的文件夹(test是我的Matlab程序名),并且我已经在Debian系统中安装了Matlab_runtime。我已根据 readme.txt 中的要求设置变量 LD_LIBRARY_PATH_ 和 _ XAPPLRESDIR_ _ *( _ 将 MCR_ROOT 替换为目标计算机上安装 MATLAB 运行时的目录。 (1) 将环境变量 XAPPLRESDIR 设置为这个值: MCR_ROOT/v91/X11/app-defaults (2) 如果环境变量 LD_LIBRARY_PATH 未定义,则将其设置为以下字符串的串联: MCR_ROOT/v91/runtime/glnxa64: MCR_ROOT/v91/bin/glnxa64: MCR_ROOT/v91/sys/os/glnxa64: MCR_ROOT/v91/sys/opengl/lib/glnxa64_)* . 我编辑我的 main.cpp 包括 test.h。当我尝试使用 _ gcc main.cpp -o main_ 编译 main.cpp 时,出现如下错误: 在 main.cpp:2:0 包含的文件中: test.h:15:22: 胎儿错误: mclmcrrt.h: 没有这样的文件或目录 #include "mclmcrrt.h"
I know that mclmcrrt.h is in the package of Matlab_runtime, it means I failed to link to the library of Matlab_runtime. Anybody knows what should I do to make my main.cpp compile successfully? I tried two days to work on how to connect to the Matlab_runtime library, but still failed. I am a beginner to linux. Great thanks if anyone can help.
【问题讨论】:
标签: c++ linux matlab-compiler