필터 지우기
필터 지우기

Compiled .EXE can't find mex, but I can see it in the CTF archive!

조회 수: 5 (최근 30일)
Matt J
Matt J 2012년 10월 25일
I've compiled an application, which contains a mex file called iprodFloat.mexw32. On the machine where I compile, it runs fine. I'll footnote here that this machine is 64-bit, running Windows 7, but I compiled the application within a 32-bit MATLAB installation.
On the target 32-bit machine, the application launches successfully, but quits with an error part way through, saying that it cannot find iprodFloat.mexw32. However, the error message gives the full path to the ctf archive folder where it failed to find the file, and when I go there, I can see the mex file sitting there in plain view. Obviously, I'm at a loss as to why the application cannot find it!
To double check, I deleted the CTF archive on the target machine and ran the .exe again. This regenerated the CTF archive, again containing iprodFloat.mexw32, but again the .exe quit with the same error.
The only thing that looks a bit suspicious to me is that the CTF archive also contains a file called iprodFloat.mexw32.auth. I'm wondering what the purpose of such a file is, and if it restricts access permission to the file somehow.
Would be grateful for any insights!
  댓글 수: 2
George
George 2012년 10월 25일
Hi Matt, I do not know what the iprodFloat.mexw32.auth file is or does.
I think that the user running the exe must have read & write permission to the directory where iprodFloat.mexw32 exists. Is that condition met on the machine where it fails?
Matt J
Matt J 2012년 10월 26일
편집: Matt J 2012년 10월 26일
Hi George, since the application partially runs, and uses other files in that directory, that seems to suggest that permissions to access the directory are present. Also, the .exe creates that directory. It doesn't seem likely that it would create it, but then not be able to access it.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2012년 10월 26일
What platform is this on? Windows 7? If so, the exe unpacks the actual executable to some hidden folder in the c:\users\Matt\blah blah blah folder. Put this line in your startup code to see where it actually lives:
ctfroot
It may not be where you thought it was. So if it is in your Users folder, permissions would not be an issue. UNLESS you did a cd() in your code - which is usually not advised. Is there a cd anywhere in your code?
Is the application that tries to use your mex file a MATLAB-compiled executable, or some other program, like one created in Visual Studio?
  댓글 수: 5
Image Analyst
Image Analyst 2012년 10월 26일
If a DLL or mex is missing a dependent file, you won't know about it since it will only mention the main one. Well it might if it uses late binding but that's rarely the case in situations I've seen - they're almost always early binding. In other words, it checks in advance for all the dependent files that it may possibly need even if it never actually does call them all. With late binding, it doesn't check for a dependent file until the time when it actually needs to call that file.
Matt J
Matt J 2012년 10월 31일
편집: Matt J 2012년 11월 9일
I overlooked Item 7 in the FAQ. It was missing the MS Visual C Redistributable.
For whatever reason, though, this is only an issue when compiling under a 32-bit MATLAB version. When I compile under 64-bit, there's no problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by