qq_35148648 2018-07-05 01:17 采纳率: 0%
浏览 1891
已结题

matlab和C++混编的程序如何运行?

文件列表
这是readme文件中的说明:

Please follow these simple instructions to get the
ToolBox working:

1) Download and unzip SegToolBox.zip from the website.

****** PRECAUTION: Please make sure that the path-name to the directory where files are unzipped does NOT contain any spaces. ******

2) Open Matlab. Cd to the unzipped directory whcih has all the files.

3) Make sure you have mex C++ compiler installed (Ex: Visual C++.)

  • To choose the compiler type "mex -setup" at the matlab commandline.
  • Follow the instructions therein until you have chosen a C++ compiler.

4) Build the library files required by the toolbox by executing
the following at the matlab commandline:

mex GraphCutSegment.cpp graph.cpp maxflow.cpp

AND
mex GraphCutSegmentLazy.cpp graph.cpp maxflow.cpp

This should create the library files (ex: FileName.dll in Windows or
FileName.mexmac in MacOS)

我按上面操作生成了一个GraphCutSegmentLazy.mexw64文件 另一个生成失败了 但是按照readme说明不是应该生成.dll文件吗?这个列表里本来就有,这个mexw64是来运行程序的吗?

程序下载的连接:http://www.cs.cmu.edu/~mohitg/segmentation.htm

  • 写回答

1条回答 默认 最新

  • qq_38542376 2018-07-05 01:21
    关注

    Matlab调用C/C++的方式主要有两种:利用MEX技术和调用C/C++动态连接库。

      在Matlab与C/C++混合编程之前,必须先对Matlab的编译应用程序mex和编译器mbuild进行正确的设置[1]:

      对Matlab编译应用程序mex的设置:Mex –setup.

      对Matlab编译器mbuild的设置:Mbuild –setup.

    评论

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误