Info

This question is closed. Reopen it to edit or answer.

Compiler Issue on 64 bit system.

1 view (last 30 days)
Amit Kalhapure
Amit Kalhapure on 19 Jul 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
I’ve a 64 bit DELL workstation. When I run a ‘Cpp’ code in matlab(32 bit) using mex command and using ‘Microsoft Visual C++ 6.0’ compiler I get some result. Now if I run the same code in Visual Studio 2010a I'm getting different result. I wonder if 64 bit system is the problem. Earlier I had a patch for VS 2010a, now that patch is removed from Matlab website that's why I use ‘Microsoft Visual C++ 6.0’ compiler.
  2 Comments
Herbert
Herbert on 19 Jul 2013
I've had also a lot of issues with different compilers, in the end the Win SDK compiler solved some of theses issues. Have you already tried this one? http://www.mathworks.de/support/compilers/R2013a/index.html
Friedrich
Friedrich on 19 Jul 2013
For now I would say it sounds like a bug in the C/C++ code w.r.t. to memory handling.

Answers (1)

Jan
Jan on 19 Jul 2013
Edited: Jan on 19 Jul 2013
32 and 64 bit compilers behave differently when the programmer assume, that e.g. size_t is equal to int or to int32. Using mwSize, mwIndex and mwSignedIndex is a secure way to write platform independent MEX files.
You find a lot of instruction of how to migrate a 32 bit C-program to 64 bit. But this problem does not concern Matlab, but CPP and therefore I suggest asking Google and searching in a CPP forum instead.

Community Treasure Hunt

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

Start Hunting!