声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1344|回复: 2

MATLAB调用C++算法的疑问

[复制链接]
发表于 2006-5-12 14:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<P>在MATLAB下调用C++编写的程序,系统有如下的警告:<BR>&gt;&gt; mex testm.cpp<BR>testm.cpp <BR>D:\Microsoft Visual Studio\VC98\INCLUDE\istream(547) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX <BR>D:\Microsoft Visual Studio\VC98\INCLUDE\complex(203) : warning C4275: non dll-interface class 'std::_Complex_base&lt;float&gt;' used as base for dll-interface class 'std::complex&lt;float&gt;' <BR>        D:\Microsoft Visual Studio\VC98\INCLUDE\complex(203) : see declaration of 'complex&lt;float&gt;' <BR>D:\Microsoft Visual Studio\VC98\INCLUDE\complex(216) : warning C4275: non dll-interface class 'std::_Complex_base&lt;double&gt;' used as base for dll-interface class 'std::complex&lt;double&gt;' <BR>        D:\Microsoft Visual Studio\VC98\INCLUDE\complex(216) : see declaration of 'complex&lt;double&gt;' <BR>D:\Microsoft Visual Studio\VC98\INCLUDE\complex(229) : warning C4275: non dll-interface class 'std::_Complex_base&lt;long double&gt;' used as base for dll-interface class 'std::complex&lt;long double&gt;' <BR>        D:\Microsoft Visual Studio\VC98\INCLUDE\complex(229) : see declaration of 'complex&lt;long double&gt;' </P>
<P><BR>不知道这样的警告是不是就不可以调用该算法,请问有和改进方法???<BR>程序编译可以生成.DLL文件,但是调用的结果不正确.<BR>谢谢</P>
回复
分享到:

使用道具 举报

发表于 2006-5-13 11:54 | 显示全部楼层
<P>我只用mex编译过c.你先找一下matlab有没有自带的c++程序,编译一下看是否正确。</P>
发表于 2006-5-13 16:00 | 显示全部楼层

回复:(leftfullba)MATLAB调用C++算法的疑问

<DIV class=tc>这是因为使用了C++异常。/EHsc或/GX,两者是等价的。<BR><BR>exception. It is equivalent to /EHsc.<BR><BR>/GX is in effect, by default, when you compile from within the development environment. By default, /GX- is enabled when using command-line tools.<BR><BR>For more information, see C++ Exception Handling.<BR><BR>To set this compiler option in the Visual Studio development environment <BR><BR>Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties. <BR>Click the C/C++ folder. <BR>Click the Command Line property page. <BR>Type the compiler option in the Additional Options box. </DIV>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-25 17:20 , Processed in 0.053299 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表