Hi,
I have downloaded a set of functions for computing exact geodesic on a surface mesh from here : http://www.mathworks.com/matlabcentral/fileexchange/18168-exact-geodesic-for-triangular-meshes
I was trying to go through the examples provided by the author, but as one of the functions makes a call to 'loadlibrary' I get the following error:
??? Error using ==> loadlibrary at 279
Microsoft Visual C++ 2005 or 2008 is required to use this feature.
I installed Microsoft Visual C++ on my machine, but this error still persists. Any help would be greatly appreciated. Thank you.

5 Comments

Try running "mex -setup" on your MATLAB. Is it able to automatically locate Visual C++? If not, you may be missing x64 compilers (by default only the 32-bit compiler is installed): http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
So here is what I did:
mex -setup
Please choose your compiler for building external interface (MEX) files:
Would you like mex to locate installed compilers [y]/n? y
Select a compiler:
[1] Microsoft Visual C++ 2010 Express in c:\Program Files (x86)\Microsoft Visual Studio 10.0
[0] None
Compiler: 1
Please verify your choices:
Compiler: Microsoft Visual C++ 2010 Express
Location: c:\Program Files (x86)\Microsoft Visual Studio 10.0
Are these correct [y]/n? y
***************************************************************************
Warning: MEX-files generated using Microsoft Visual C++ 2010 require
that Microsoft Visual Studio 2010 run-time libraries be
available on the computer they are run on.
If you plan to redistribute your MEX-files to other MATLAB
users, be sure that they have the run-time libraries.
***************************************************************************
Trying to update options file: C:\Users\Anton\AppData\Roaming\MathWorks\MATLAB\R2010b\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2010b\bin\win64\mexopts\msvc100freeopts.bat
Done . . .
**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/support/solutions/en/data/1-5C27B9/?solution=1-5C27B9
Building with the -largeArrayDims option enables the new API.
**************************************************************************
So I guess it was able to locate the compiler. However, I am not sure if it was the 64bit one.
I tried running the above examples again, but still get the same error ...
Any idea what else I could try?
Maybe the error needs to be taken literally: that for some reason it requires C++ 2005 or 2008, whereas you are using C++ 2010. For example perhaps it requires SDK 6.1 for some reason.
http://www.mathworks.com/support/compilers/R2011b/win64.html
Hi Walter,
well, you could really help if you tried running one the examples (from above mentioned toolbox) on your machine. Does it work for you?
My MATLAB machine is Linux, not MS Windows.

Sign in to comment.

 Accepted Answer

Kaustubha Govind
Kaustubha Govind on 3 Feb 2012

0 votes

For versions older than R2011a, Visual Studio Express (free) editions were not supported with LOADLIBRARY - the support was added in R2011a. However, it looks like this user has been able to use some clever tweaks to make even older versions work with the Express versions: http://www.mathworks.com/matlabcentral/newsreader/view_thread/281365

2 Comments

Thanks for clearing that up
So going back to a supported C++ 2008 would have worked. Too bad no-one happened to suggest anything helpful along those lines...

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!