当前位置:网站首页>Matlab-mex
Matlab-mex
2022-07-15 16:15:00 【qq_41955225】
1 问题
有个老模型采用的是matlab2011b版本建模,当时是32位系统,mex生成的可执行程序是*.mexw32的,随着电脑的升级,变成了64位系统,因此报出无法找到s-fun的错误;
2 解决
2.1 编译生成*.mexw64的目标文件
(1)安装VS2008(对应Matlab2011b版本),注意VS的版本一定更要比matlab的版本低,否则无法识别。
版本可以到如下MATLAB安装目录下看支持哪个版本的VS:
D:\App\MatlabR2011b\bin\win64\mexopts

(2)设置mex参数:

(3)编译
>> mex Sfun_usLookup_xy_us.c
正在创建库 C:\Users\js\AppData\Local\Temp\mex_40Cy3a\templib.x 和对象 C:\Users\js\AppData\Local\Temp\mex_40Cy3a\templib.exp
xx1.obj : error LNK2019: 无法解析的外部符号 xx_xy_us,该符号在函数 mdlOutputs 中被引用
xx1.mexw64 : fatal error LNK1120: 1 个无法解析的外部命令 出现这种情况是无法找到xx_xy_us函数对应的文件
办法:将对应的文件拷贝到同一目录下,同时加入编译,xx_xy_u函数被包含在xx_ft_simu.c中。
>> xxx1.c xx_ft_simu.c顺利编译出*.mexw64的目标文件
编译过程中如果找不到.h的文件,则将.h文件放到VC2008的目录下:
D:\Apps\38_Microsoft Visual Studio_2008\VC\include
2.2 安装虚拟机
虚拟机中安装32位win系统,这样跑模型的时候可以沿用*.mexw32的目标文件。
虚拟机安装系统的时候需要先通过纯净版的xp系统文件引导XTC_GHOST_WIN10_32_2021_6.iso;然后安装虚拟机系统GHOST_WIN10_X86_VDL_2022_203072.iso

边栏推荐
- STM32F4的外部中断
- 迪文串口屏教程(1)
- 【golang】基于go语言的堆结构模板
- Sword finger offer punch stack queue heap
- 数据类型新用法与解构赋值
- 杰理之调式时要修改 INI 文件配置【篇】
- Where can I find the computer network speed detection
- vi编辑器命令
- MQ系列2:消息中间件的技术选型
- The software supply chain security risk that makes enterprise digitalization and it executives bear the brunt of the cauldron points to the north
猜你喜欢

How can win11 maximize the software interface by default? Win11 opens the software interface by default to maximize

数据类型新用法与解构赋值

郑州大学数据库课设资源说明

let / const /var的区别

Notes on Linear Algebra 1

Practice of online problem feedback module (III): automatically generate all controller, service, mapper and other files

仅需三步 轻松实现远程办公

ECCV 2022 | multi domain long tail distributed learning, research on unbalanced domain generalization (open source)

Pychart tutorial: 5 very useful tips

企业在创建产品帮助中心时需要注意的问题!
随机推荐
Digital ecological map of human resources in China - flexible employment market
[golang] heap structure template based on go language
动画以及封装(offset、client、scroll系列)
ECCV 2022 | 多域长尾分布学习,不平衡域泛化问题研究(开源)
How can win11 maximize the software interface by default? Win11 opens the software interface by default to maximize
[special topic of golang database 4] golang language operation PostgreSQL for addition, deletion, modification and query
32 project code area meaning based on Hal library, and common function examples
40 + times improvement, explain in detail how to optimize the performance of juicefs metadata backup and recovery
Notes on linear algebra 2
杰理之入耳检测功能【篇】
如何在企业工作中应用知识管理,解决企业的问题?
Analysis of keepalive keeping alive mechanism of TCP protocol layer in IM development
如何将notepad++设置为默认打开方式
2022安全员-C证特种作业证考试题库及答案
Intensive reading of the paper: deep reinforcement learning and intelligent transportation (I)
线性代数 笔记2
【30天30个小项目】菜单悬停动画
如何將notepad++設置為默認打開方式
2022年智能运维企业50强,博睿数据实力入选
迭代器与生成器