From: Kwok on
Excuse me, may I ask something about matlab?

In the matlab, I have defined a function test1 in the .m file.
After that, when I used that test1 function within the matlab command window. It works as expected.

However, after I tried to use mcc command to create a C++ shared library of the function test1, then immediately the function test1 can no longer be used in the matlab command window.

The following is what I got from the matlab command window. I got the error even before I starts to reference the function test1 in any C++ code.
May I ask what I may do to deal with the problem?
Thank you very much for your attention


>> test(0,0,0,0,0,0,0,0,0)

ans =

1 0 0

>> mcc -B csharedlib:find_surface_normal find_surface_normal.m
MATLAB:I18n:InconsistentLocale - The system locale setting, 中文 (香港特別行政區)_香港特別行政區.950, is different from the user locale setting, 中文 (台灣)_台灣.950.

>> test1(0,0,0,0,0,0,0,0,0)
Mex file entry point is missing. Please check the (case-sensitive)
spelling of mexFunction (for C MEX-files), or the (case-insensitive)
spelling of MEXFUNCTION (for FORTRAN MEX-files).
??? Invalid MEX-file 'C:\Documents and Settings\JASPER KWOK\My Documents\MATLAB\find_surface_normal.dll':



From: Ashish Uthama on
On Mon, 22 Dec 2008 13:34:02 -0500, Kwok <jasper5674(a)hotmail.com> wrote:

> Excuse me, may I ask something about matlab?
>
> In the matlab, I have defined a function test1 in the .m file.
> After that, when I used that test1 function within the matlab command
> window. It works as expected.
>
> However, after I tried to use mcc command to create a C++ shared library
> of the function test1, then immediately the function test1 can no longer
> be used in the matlab command window.
>
> The following is what I got from the matlab command window. I got the
> error even before I starts to reference the function test1 in any C++
> code.
> May I ask what I may do to deal with the problem?
> Thank you very much for your attention
>
>>> test(0,0,0,0,0,0,0,0,0)
>
> ans =
>
> 1 0 0
>
>>> mcc -B csharedlib:find_surface_normal find_surface_normal.m
> MATLAB:I18n:InconsistentLocale - The system locale setting,
> &#20013;&#25991;
> (&#39321;&#28207;&#29305;&#21029;&#34892;&#25919;&#21312;)_&#39321;&#28207;&#29305;&#21029;&#34892;&#25919;&#21312;.950,
> is different from the user locale setting, &#20013;&#25991;
> (&#21488;&#28771;)_&#21488;&#28771;.950.
>
>>> test1(0,0,0,0,0,0,0,0,0)
> Mex file entry point is missing. Please check the (case-sensitive)
> spelling of mexFunction (for C MEX-files), or the (case-insensitive)
> spelling of MEXFUNCTION (for FORTRAN MEX-files).
> ??? Invalid MEX-file 'C:\Documents and Settings\JASPER KWOK\My
> Documents\MATLAB\find_surface_normal.dll':
>
>
>

Essentially:
1. MATLAB recognizes .DLL file extension for MEX files ( a legacy issue).
2. MEX files get picked over M files for files with same name

So MATLAB thinks the DLL file you created (find_surface_normal.dll) is a
MEX file and uses it instead of find_surface_normal.m

Depending on your convenience, you could either move the DLL file to a
different directory after creation or create them in a different directory
(-d option to MCC).

 | 
Pages: 1
Prev: define solinit
Next: Engine control design