C compiler for MEX files

Hi all, I wrote a C code that uses the most common libraries such as stdint.h. I've done a proper mex file for it which compiles correctly under linux/os x. However I have some issues under windows: the compiler does not recognize the stdint.h library.
I've used the LCC win32 compiler. I've tried some many others compilers but MATLAB can not find them on my machine.
What can I do?
Thank you so much.

回答 (1 件)

Jan
Jan 2012 年 1 月 4 日

0 投票

The different integer types are defined in tmwtypes.h already, which is included in the mex.h automatically. Therefore the C99 stdint.h is hardly ever needed when compiling a Mex file.
Btw. MSVC 2010 does have stdint.h in the \include folder. The LCC version shipped with Matlab is very old.
Another hint: You can be sure, that this problem has happened before. Then it is a smart idea to ask Google: http://www.google.de/search?q=stdint.h+windows

7 件のコメント

Nicholas
Nicholas 2012 年 1 月 4 日
I perfectly understand what you are saying, but I can not use MSVC in my MATLAB (R2009b) and I do not know why? I installed the express version but mex setup could not find it on my machine!
How is it possible?
Friedrich
Friedrich 2012 年 1 月 4 日
This is because MSVC 2010 express is not supported by R2009b:
http://www.mathworks.com/support/compilers/R2009b/
Try the MSVC 2008 express.
James Tursa
James Tursa 2012 年 1 月 4 日
Or create mexopts.bat files that support 2010.
Nicholas
Nicholas 2012 年 1 月 4 日
@James
And how can I do that?
can somebody please tell me how to add a new compiler different from lcc?
Thanks..
Nicholas
Nicholas 2012 年 1 月 4 日
I have MSVC 2008 Express but MATLAB can not find it!
Friedrich
Friedrich 2012 年 1 月 4 日
Are you on 64bit OS with 64bit MATLAB? If so you ahve to make sure that the SDK is installed and you selected x64 compiler and tools during the installation:
http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
Nicholas
Nicholas 2012 年 1 月 4 日
@Friedrich
Sorry but I'm still using win32 machine
What do I have to do?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

質問済み:

2012 年 1 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by