连接到Matlab引擎从C在Linux中 [英] Connect to Matlab engine from C in Linux

查看:178
本文介绍了连接到Matlab引擎从C在Linux中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Linux(Matlab的r2009a,Ubuntu 9.10的)一​​个C程序编程调用Matlab引擎。

I'm trying to call the Matlab engine programatically from a C program on Linux (Matlab r2009a, Ubuntu 9.10).

我有我自己的code(这在Windows工作),但现在我只是试图让Matlab的engdemo.c计划在Linux上运行。我已成功地编译和放大器;其链接(包括大约15后 -l< LIB> 切换GCC命令行),甚至解决了所有通过某些ldconfig的魔法运行时动态链接

I've got my own code (which works in Windows), but for now I'm just trying to get the Matlab "engdemo.c" program to work on Linux. I have managed to compile & link it (after including about 15 -l<lib> switches on the gcc command line), and even resolved all the runtime dynamic links via some ldconfig magic.

不过,当程序运行时,我刚刚得到的无法启动Matlab引擎的错误消息,并且程序结束,没有指示失败的原因。

But, when the program runs, I just get the "Can't start MATLAB engine" error message and the program ends, with no indication of why it failed.

有没有人做这项工作?我有什么忘了怎么办?

Has anybody made this work? What have I forgotten to do?

P.S。我本来问这个超级用户,因为我认为这是配置相关的,但我看到其他Matlab引擎相关的?是在这里,所以我想我给它一个去。

p.s. I originally asked this on SuperUser because I think it's configuration related, but I see other Matlab engine-related ?'s here so I thought I'd give it a go.

推荐答案

您应该在你的C程序运行 strace的,看看那里出问题。通常情况下,我发现大部分归结为时间之一:

You should run strace on your C program to see where things go wrong. Typically, I found that most of the time it comes down to either:


  • 不具有 CSH 安装

  • 具有环境设置错误,有时 LS_COLORS 螺丝钉的事了 CSH

  • Not having csh installed
  • Having the environment set wrong, sometimes LS_COLORS screws things up with csh

这篇关于连接到Matlab引擎从C在Linux中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆