LOADLIBRARY error 'CL' and LIMITS.H not found

13 views (last 30 days)
Bruno Luong
Bruno Luong on 20 Nov 2020
Commented: Bruno Luong on 20 Nov 2020
I get this error message recently
>> loadlibrary('C:\WINDOWS\system32\user32.dll', 'WinMouse.h')
Error using loadlibrary
Failed to preprocess the input file.
Output from preprocessor is:'cl' is not recognized as an internal or external command,
operable program or batch file.
I was working not long ago, in between there is these updates occured on my PC
  • Windows 10 update (20H2 OS Build 19042.661)
  • MSVC 2019 C Community, update (16.8.2)
  • MATLAB V2020b update 2.
I experimental add the path of cl command in the Environment variable and get other strange error
>> loadlibrary('C:\WINDOWS\system32\user32.dll', 'WinMouse.h')
Error using loadlibrary
Building user32_thunk_pcwin64 failed. Compiler output is:
cl -I"C:\Program Files\MATLAB\R2020b\extern\include" /Zp8 /W3 /nologo
-I"C:\Users\Bruno\Documents\MATLAB\MiscTools"
-I"C:\Users\Bruno\Documents\MATLAB\MiscTools" "user32_thunk_pcwin64.c" -LD
-Fe"user32_thunk_pcwin64.dll"
user32_thunk_pcwin64.c
C:\Program Files\MATLAB\R2020b\extern\include\tmwtypes.h(32): fatal error C1083: Cannot open include file: 'limits.h': No such file
or directory
Any pointer?
  1 Comment
Bruno Luong
Bruno Luong on 20 Nov 2020
Update:
  • I install MSVS 2017 and uninstall MSVS 2019.
  • Open MATLAB, rerun mex --setup
And now it works again.
So it seems there is a compatibility issue between MATLAB (R2020B) and MSVC 2019 C Community, (16.8.2)

Sign in to comment.

Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) 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!