Problem trying to load .dll library using 'loadlibrary', error is, A 'Selected' compiler was not found. You may need to run mex -setup.
Show older comments
I am a beginner on using the loadlibrary function and using .dll files, so I will appreciate any help I can get.
I am trying to load a .dll file with a header file, I am using:
>> loadlibrary('nameoflibrarydll', 'nameofheaderfile')
and it comes up with the error:
??? Error using ==> loadlibrary at 264 A 'Selected' compiler was not found. You may need to run mex -setup.
I do not understand what 'mex' is?
I think a problem is is that the .dll file is written using an old version of Matlab, and it needs to be used using Matlab 2011a. This is so that I can access functions from the header file, the codes of which probably need updating also to run in the new version of Matlab.
I also tried the same line of code for loadlibrary on a different computer and it comes up with the error:
C:\Users\User One\Documents\MATLAB Pentools\Wintab32.dll is not a valid Win32 application.
I understand the problem is to do with 32 bit and 64 bit versions of windows, but I do not understand what this means. If anyone could help explain what all the terminology means and how you think I may be able to proceed with accessing the .dll file, I would be most grateful.
Accepted Answer
More Answers (1)
Pang Pang
on 17 Aug 2017
0 votes
In environment, select add-on. Search for MinGW-w64 Compiler and install. Just type in (mex -setup) without the parentheses in the command window once installation finishes.
Categories
Find more on Startup and Shutdown 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!