can't find Matlab coder generated mexFunction
Afficher commentaires plus anciens
Hello,
I used Matlab Coder to generate a randn mexFunction and used it in another mexFunction. The code runs perfectly well on two computers but not on the third one. Matlab said can't find randn1.mexw64.
What could have happened?
Thanks.
Réponses (2)
Titus Edelhofer
le 2 Mai 2012
Hi,
perhaps the third computer is a 32bit MATLAB/Windows? Just enter
mexext
in the 3rd computer. If it returns mexw32, you have to generate and compile the code on the 3rd computer again ...
Titus
11 commentaires
Jane Jean
le 2 Mai 2012
Titus Edelhofer
le 2 Mai 2012
I'm not sure, I guess no. What you definetely can do is to install the 32Bit MATLAB in parallel to your 64Bit MATLAB and generate the randn1.mexw32 there.
Jane Jean
le 2 Mai 2012
Kaustubha Govind
le 2 Mai 2012
Jane: Please look at these instructions for installing 32-bit MATLAB on a 64-bit machine. I think you need to simply activate the 32-bit version also with the same license number as the 64-bit version to get access to MATLAB Coder on it. I would recommend contacting MathWorks Installation/Licensing Support if you run into issues.
Titus Edelhofer
le 2 Mai 2012
Hi Jane,
installing the 32 bit version you don't run the setup.exe in the top folder but run the setup.exe in the win32 folder...
Titus
Jane Jean
le 2 Mai 2012
Titus Edelhofer
le 3 Mai 2012
Hi Jane,
those files are all in the same folder, so it's not a path issue? Then my ideas slowly fade out ... sorry. And I guess the laptop has the same version/release of MATLAB running?
Titus
Jane Jean
le 4 Mai 2012
Kaustubha Govind
le 4 Mai 2012
Jane: The "module not found" type error is typically thrown if the MEX file depends on other DLLs that could not be found on the machine where it is being run. Assuming that you don't load other DLLs from your MEX-file, my best guess is that you used Visual Studio to generate the MEX-file and that you don't have the corresponding Visual C++ redistributables installed on the target laptop. See this solution for more information: http://www.mathworks.com/support/solutions/en/data/1-94SRDF/index.html (Be sure to get the redistributables for the version of Visual Studio that you used with MATLAB Coder)
Jane Jean
le 4 Mai 2012
Jane Jean
le 4 Mai 2012
Jane Jean
le 4 Mai 2012
0 votes
4 commentaires
Kaustubha Govind
le 4 Mai 2012
Those libraries ship with MATLAB and should be in $matlabroot/bin/win64. Are you using a different version of MATLAB on the laptop?
Regarding your previous comment, MATLAB Coder uses Visual Studio (or whatever compiler was selected using "mex -setup") in the back-end to compile the MEX binary from C code that it generated.
Are you sure that Dependency Walker doesn't also point to any MSVC libraries missing?
raym
le 8 Nov 2024
I encounter the same problem: the mex file cannot run with error:invalid mex-file the specified module could not be found.
dependencywalker shows the only missing files are those dlls.
raym
le 8 Nov 2024
After I add bin/win64 folder to systen path and relaunch the dependencywalker, now the Mathwork dlls got resolved, and further walking reveals new missing dlls.
API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL
API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL
API-MS-WIN-CORE-SHUTDOWN-L1-1-1.DLL
API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
raym
le 8 Nov 2024
But the dlls exsit in my PC:
C:\Windows\System32\downlevel\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\SysWOW64\downlevel\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_2c5177c069a919dd\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_d032dc3cb14ba8a7\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\API-MS-Win-Core-Kernel32-Private-L1-1-1.dll
-----
C:\Windows\System32\downlevel\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\SysWOW64\downlevel\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_2c5177c069a919dd\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_d032dc3cb14ba8a7\api-ms-win-core-privateprofile-l1-1-1.dll
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-core-privateprofile-l1-1-1.dll
-----this one may be missing, I will copy it and have a try
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-core-shutdown-l1-1-1.dll
-----
C:\Users\rmd\AppData\Local\GeoGebra_6\app-6.0.583\api-ms-win-service-private-l1-1-1.dll
C:\Windows\System32\downlevel\api-ms-win-service-private-l1-1-1.dll
C:\Windows\SysWOW64\downlevel\api-ms-win-service-private-l1-1-1.dll
C:\Windows\WinSxS\amd64_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_b8233abb5511544f\api-ms-win-service-private-l1-1-1.dll
C:\Windows\WinSxS\x86_microsoft-windows-m..namespace-downlevel_31bf3856ad364e35_6.3.9600.16384_none_5c049f379cb3e319\api-ms-win-service-private-l1-1-1.dll
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!