声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1569|回复: 2

[混合编程] 如何把VC++源文件 转换成 在matlab下 可以使用的文件

[复制链接]
发表于 2011-3-12 19:39 | 显示全部楼层 |阅读模式

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

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

x
求助:如何把VC++源文件 转换成 在matlab下 可以使用的文件?
我想把这个tree.c 文件转换,提示错误如下:请问是什么原因?谢谢指教!
mex -setup
Please choose your compiler for building external interface (MEX) files:

Would you like mex to locate installed compilers [y]/n? y

Select a compiler:
[1] Digital Visual Fortran version 6.0 in C:\Program Files\Microsoft Visual Studio
[2] Lcc C version 2.4.1 in D:\MATLAB\sys\lcc
[3] Microsoft Visual C/C++ version 6.0 in C:\Program Files\Microsoft Visual Studio

[0] None

Compiler: 3

Please verify your choices:

Compiler: Microsoft Visual C/C++ 6.0
Location: C:\Program Files\Microsoft Visual Studio

Are these correct?([y]/n): y

Try to update options file: C:\Documents and Settings\Administrator\Application Data\MathWorks\MATLAB\R14SP3\mexopts.bat
From template:              D:\MATLAB\BIN\win32\mexopts\msvc60opts.bat

Done . . .

***************************************************************************
  Warning: The file extension of 32-bit Windows MEX-files was changed
           from ".dll" to ".mexw32" in MATLAB 7.1 (R14SP3). The generated  
           MEX-file will not be found by MATLAB versions prior to 7.1.
           Use the -output option with the ".dll" file extension to
           generate a MEX-file that can be called in previous versions.
           For more information see:  
           MATLAB 7.1 Release Notes, New File Extension for MEX-Files on Windows
***************************************************************************

>> mex tree.c
tree.c
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(24) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(24) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(71) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(71) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(73) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(73) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(74) : error C2061: syntax error : identifier 'wstreampos'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(74) : error C2059: syntax error : ';'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(76) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(76) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(137) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(137) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(176) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(176) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(215) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(215) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(217) : error C2061: syntax error : identifier 'ios_base'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(217) : error C2059: syntax error : ';'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(218) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(218) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(220) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(220) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(222) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(222) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(224) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(224) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(226) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(226) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(228) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(228) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(230) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(230) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(232) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(232) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(235) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(235) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(238) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(238) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(241) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(241) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(244) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(244) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(246) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(246) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(248) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(248) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(250) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(250) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(254) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(254) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(255) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(255) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(256) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(257) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(257) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(258) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(258) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(259) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(259) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(261) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(261) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(263) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(263) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(265) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(265) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(267) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(267) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(268) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(268) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(269) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(269) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(270) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(270) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(272) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(272) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(273) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(273) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(275) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(275) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(276) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(276) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(277) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(277) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(278) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(278) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(280) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(280) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(282) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(282) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(284) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(284) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(286) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(286) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(287) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(287) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(288) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(288) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(289) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(289) : error C2059: syntax error : '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(292) : error C2143: syntax error : missing '{' before '<'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\iosfwd(292) : fatal error C1003: error count exceeds 100; stopping compilation

  D:\MATLAB\BIN\MEX.PL: Error: Compile of 'tree.c' failed.

??? Error using ==> mex
Unable to complete successfully
回复
分享到:

使用道具 举报

发表于 2011-3-18 12:08 | 显示全部楼层
看一下混合编程吧
发表于 2011-3-18 12:18 | 显示全部楼层
依我看,是源文件 tree.c 有语法错误吧!
error C2143: syntax error : missing '{' before '<'
error C2059: syntax error : '<'

这应该不是matlab的问题
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-11-16 09:54 , Processed in 0.062371 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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