Executing a rountin in mexw32 binary compiled with Visual Studio 2010

조회 수: 2 (최근 30일)
Hello,
I built a mexw32 binary with Visual Studio 2010 by the build instruction in the Help. The build was successful but using the function was not.
The mexw32 file is put in a directory and I tried to call the function in that directory but Matlab cannot see the function.
I wonder if there is some other things that are not fully explained int the help. Help will be greatly appreciated. Thanks.
Seongjoo

채택된 답변

Seongjoo Lee
Seongjoo Lee 2011년 3월 5일
I figured out what the problem was:
When building a mexw32 with IDE (Visual Studio), Module Definition file (.def) is required. When I wrote the def file, I named the library as 'myfunction'
LIBRARY myfunction
EXPORTS mexFunction
However, the mexw32 file name was not 'myfunction'. After I named the mexw32 file same as the name specified in def file, I can correctly evoke the function in Matlab.
The reason why I wanted to use Visual Studio for building mexw32 is that I can deal with a single interface to build the binary. Of course, mex -O -c code.cpp is not too difficult, but managing projects having dependencies to multiple libraries is quickly becoming a complex task. For that task, Visual Studio is a good tool.
Thanks for participating for the issue!

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 4일
How are you trying to invoke the function? Is the directory of the function your current directory, or is it on your path? Did you rehash your path after you created the .mex32 ?
  댓글 수: 3
Jan
Jan 2011년 3월 4일
Please post more details. What do you mean with "routine inside of the file"?
Seongjoo Lee
Seongjoo Lee 2011년 3월 5일
I just meant a function wrapped in mexFunction :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by