Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
loadlibrary Windows 64 bit using Visual C++ 2008 Express

Subject: loadlibrary Windows 64 bit using Visual C++ 2008 Express

From: Dietrich Lueerssen

Date: 5 May, 2010 14:26:04

Message: 1 of 5

Dear fellow MATLABbers,

I need to use for one of my projects a 64 bit Windows system, and I need to use a 64 bit DLL.
On a 64 bit system, this requires a compiler to be installed. The MathWorks does not support the free Visual C++ Express for this purpose.

I have still been able to make it work, and the change is simple for anyone to carry out.

Steps:
1. Install Visual C++ 2008 Express (should also work with 2010, but I have not tested that).
2. Install Windows SDK (I used version 7.0).
3. Follow Jens Huebel's instructions to make VCE use the new SDK (http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/); this is the part that takes longest, but it is worth it.
4. One of the BAT files included with the VCE installation gets the path of some components wrong. This file needs to be edited: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat and the location of the BAT files adjusted.
5. I have the MATLAB compiler and configure it using 'mbuild -setup'; maybe this step is not required for you?

Et voila, my system was able to use loadlibrary on a Windows 7 64 bit without the need to buy the Microsoft compiler.

I hope this is helpful for you as well.

Subject: loadlibrary Windows 64 bit using Visual C++ 2008 Express

From: Patrick

Date: 21 Dec, 2010 22:29:06

Message: 2 of 5

"Dietrich Lueerssen" wrote in message <hrrv5s$9cu$1@fred.mathworks.com>...
> ...
> 3. Follow Jens Huebel's instructions to make VCE use the new SDK (http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/); this is the part that takes longest, but it is worth it.

That link is broken, has anyone else tried this?

Subject: loadlibrary Windows 64 bit using Visual C++ 2008 Express

From: Yogesh

Date: 21 Dec, 2010 22:48:07

Message: 3 of 5

The presently working link referred in earlier communication is
http://jenshuebel.wordpress.com/2009/02/12/visual-c-2008-express-edition-and-64-bit-targets/
with regards
YP

Subject: loadlibrary Windows 64 bit using Visual C++ 2008 Express

From: Patrick

Date: 21 Dec, 2010 23:40:19

Message: 4 of 5

Actually I have an additional question .. is this only for 64-bit MATLAB running on 64-bit Windows? I am having a problem loading a 32-bit library on 32-bit MATLAB on 64-bit Windows. The library will load, but it won't be able to recognize any of the data types ... (like UCHAR, PVOID, DWORD, etc.) so everything gets returned as type 'error' I don't have this problem on 32-bit MATLAB on 32-bit Windows.

Subject: loadlibrary Windows 64 bit using Visual C++ 2008 Express

From: Patrick

Date: 22 Dec, 2010 23:27:05

Message: 5 of 5

It turned out it was just a header issue, using addheader and addpath fixed those errors. Now I can load the library no problem, but the problem is it will crash when I try to call a function which opens up a USB port.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us