loadlibrary calls lcc by default

2 次查看(过去 30 天)
Hi, I am using R2010b SP1 running on Windows XP Professional SP3 (32 bit). I am trying to use loadlibrary to access a DLL within MATLAB. I have run mex -setup and set up MATLAB to use Microsoft Visual C++ 2010 Express. However, when I try executing the loadlibrary command, I get a message saying "lcc preprocessor error" indicating that it is trying to call lcc. Is that supposed to be the default behaviour? The supported compilers page indicates that Visual C++ 2010 Express is fully supported.
Thanks.

采纳的回答

Kaustubha Govind
Kaustubha Govind 2011-11-9
Yes, I believe in R2010b and earlier versions, the use of LCC to parse symbols is the default behavior of LOADLIBRARY. However, in R2011a, LOADLIBRARY started honoring the compiler chosen with "mex -setup". If you do not plan to upgrade, you can try first running the MSVC preprocessor on your header file to produce the corresponding .i file, and then provide that in place of the header to LOADLIBRARY, so that the preprocessor is not run.
You should be able to run the MSVC pre-processor on your header with this command from the Visual C++ command window:
cl myheader.h /P

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by