howto: mex Matlab r2008a + MS Visual C/C++ Prof Edition 2008, win64

Hi, I am having problems with setting up matlab r2008a to
compile C++ mex files with Visual Studio 2008 prof. on
windows XP 64bits.

When I run mex -setup, matlab doesn't find any compilers.
If i choose not to let matlab locate compilers:

mex -setup
Please choose your compiler for building external interface
(MEX) files:

Would you like mex to locate installed compilers [y]/n? n

Select a compiler:
[1] Intel C++ 9.1 (with Microsoft Visual C++ 2005 linker)
[2] Intel Visual Fortran 10.1 (with Microsoft Visual C++
2005 linker)
[3] Intel Visual Fortran 9.1 (with Microsoft Visual C++
2005 linker)
[4] Microsoft Platform SDK 14.0
[5] Microsoft Visual C++ 2005
[6] Microsoft Visual C++ 2008

[0] None

Compiler: 6

The default location for Microsoft Visual C++ 2008
compilers is C:\Program Files (x86)\Microsoft Visual Studio
but that directory does not exist on this machine.

Use C:\Program Files (x86)\Microsoft Visual Studio 9.0
anyway [y]/n? y

Please verify your choices:

Compiler: Microsoft Visual C++ 2008
Location: C:\Program Files (x86)\Microsoft Visual Studio

Are these correct [y]/n? y

Warning: MEX-files generated using Microsoft Visual C++
2008 require
that Microsoft Visual Studio 2008 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

Trying to update options file: C:\Documents and
From template: C:\PROGRA~1

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
Building with the -largeArrayDims option enables
the new API.

Visual Studio 9.0 is installed in "C:\Program Files (x86)
\Microsoft Visual Studio 9.0\", the same directory where
matlab try to find it.

When I then try to mex a file:

mex test.cpp -v -g
This is mex, Copyright 1984-2007 The MathWorks, Inc.

-> Default options filename found in C:\Documents and
Settings\svepe\Application Data\MathWorks\MATLAB\R2008a
-> Options file = C:\Documents and
MATLAB = C:\PROGRA~1\Matlab\R2008a
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = -c -Zp8 -GR -W3 -EHs -
DEBUGFLAGS = -Zi -Fd"test.mexw64.pdb"
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
= /dll /export:mexFunction /MAP /LIBPATH:"C:\PROGRA~1
\Matlab\R2008a\extern\lib\win64\microsoft" libmx.lib
libmex.lib libmat.lib /implib:C:\DOCUME~1\svepe\LOCALS~1
\Temp\mex_7pRkhg\templib.x /MACHINE:X64 kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
= /DEBUG /PDB:"test.mexw64.pdb"
Name directive = /out:"test.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =

--> cl -c -Zp8 -GR -W3 -EHs -D_CRT_SECURE_NO_DEPRECATE -
\Temp\mex_7pRkhg\test.obj -IC:\PROGRA~1
\Matlab\R2008a\extern\include -IC:\PROGRA~1
\Matlab\R2008a\simulink\include -Zi -Fd"test.mexw64.pdb" -
DMX_COMPAT_32 H:\Exjobb\run\test.cpp

C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Compile
of 'test.cpp' failed.

I have read that on earlier versions of matlab you could
solve this by setting the environment variable, MSSDK to
the path where platform SDK where. I have installed
microsoft SDK v6.0a. I can find it in the paths:
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A
C:\Program Files\Microsoft SDKs\Windows\v6.0A
so Im not shure which path to use.

Does anyone know or have clue how to fix this problem?