作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 matlab 中有一个函数,它编写了我在我的 qt 项目中使用的 file.txt。
所以,
当我得到一个使用 unix() 运行的 qt 编译可执行文件时,我有一个 Matlab 文件,但是我收到了一个错误。
编码:
unix('/home/matt/Desktop/PlaneVolumeFinal/PlaneVolumeGui');
/home/matt/Desktop/PlaneVolumeFinal/PlaneVolumeGui: symbol lookup error: /home/matt/Desktop
/PlaneVolumeFinal/PlaneVolumeGui: undefined symbol: _ZN9QListData7detach3Ev
最佳答案
正如@grungetta 所指出的,这个问题可能与 MATLAB 本地库路径没有看到您的 Qt 库有关,例如 libQtMultimedia.so
, 通常应该在任何 shell session 中通过 LD_LIBRARY_PATH
可见的路径中变种。
解决此问题的一种方法是显式设置 LD_LIBRARY_PATH
的值。从 MATLAB 运行 session 中(如果需要继续,则重新存储它)。您的 MATLAB 脚本的示例命令集可能是:
%*** save local (MATLAB's) LIBRARY PATH
libPathLocal = getenv('LD_LIBRARY_PATH');
%*** set your global LIBRARY PATH
PATH_LD_LIBRARY = '/usr/lib/' % or any string containing library files required
setenv('LD_LIBRARY_PATH', PATH_LD_LIBRARY);
%*** call binary through 'unix' or 'system'
system('/home/matt/Desktop/PlaneVolumeFinal/PlaneVolumeGui');
%*** restore session's MATLAB's library path
setenv('LD_LIBRARY_PATH', libPathLocal);
关于qt - 如何从 matlab 调用 Qtproject?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12350282/
我是一名优秀的程序员,十分优秀!