mexw64已被打开

10 views (last 30 days)
雨涵 陈
雨涵 陈 on 2 Jun 2022
Answered: cdarling on 4 Jun 2025
运行mexw64文件,再次编译会报cannot open output file xxx.mexw64:Permission denied collect2.exe: error: ld returned 1 exit status
  2 Comments
倩 刘
倩 刘 on 7 Oct 2022
请问你解决了嘛,我也出现这个问题,一直显示文件被占用
茄宇
茄宇 on 8 May 2025
  1. use command: "clear your_mex_file_name" or "clear mex"

Sign in to comment.

Answers (1)

cdarling
cdarling on 4 Jun 2025
可参考评论中的内容
感谢@茄宇的分享
因为正在使用中的文件是无法删除的,这是操作系统的限制,与MATLAB无关
因此需要释放正在占用的文件
你在生成mex之后应该是运行过它,所以它已经加载到MATLAB环境中了,这个文件是打开状态
要重新生成,就需要覆盖之前生成的文件,因此要清除之前加载的程序
换种方式理解,相当于打开的word文件也无法直接覆盖或者删除,需要关闭文件,再删除或者覆盖

Categories

Find more on 安装和许可简介 in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!