I am trying to compile the C shared library with matlab. My matlab code uses a lot of image processing functionality, so the compilation is okay, but when I call DLL from my application, I get the message, "Undefined function or method for double type input arguments 'XYZ'. I have fixed my argument - this is not a problem, therefore, I tried to add% # function XYZ to my .m file, but it does not help anything Again, I tried to use the flag in my compile command:
eval (['mcc -v -n -w lib: cshared -d' clibdir '-t link: lib - One edge 'allfiles]);
but fails to compile it:
Depfun error:' unable to detect edge as a function on MATLAB path ' / P>
I have confirmed image processing files are on my computer (I can run everything from matlab with no problem), and my path is that directive , Which is included in it.
I have also tried to copy files in my work directory, but this is a lot of files in the balloon and, for some functions, nobody is here. M - Just an .mex - and me me There is no way to include a Max file in Dll.
What am I missing?
Include the image processing toolbox folder using the -a
option Have tried? For example: according to:
mcc ... -a c: \ program files \ MATLAB \ r2009a \ toolbox \ images \ images
, all Files in this folder, as well as all files of all subfolders, are added to CTF archive, and the folder is subtitled in the subtitle CTF archive.
If you do not want to include every subfolder, you can load files in only one folder using a wildcard pattern:
mcc ... - Ac: \ Program Files \ MATLAB \ r2009a \ toolbox \ images \ images \ *
It may be necessary that a subfolder can be functions or scripts that shadow people in the original folder Can do. For example, there is a edge.m
function in the original folder C: \ Program Files \ MATLAB \ R2009a \ toolbox \ images \ images \
, and one (on Windows) , One of which is also called edge.m
. You do not want to add this subfolder when you compile, so that you either:
-
Temporarily remove that subfolder, add a parent folder without the wildcard option (add other subfolders You want to), then bring that folder back.
-
Add the original folder with the wildcard option (to add files only), then separate only you want to add sub-folders (such as
@strel < / Code> and
private
) with an additional-a
command. Note: If subfolders are added separately, the folder subtitle of the parent directory will be maintained in the CTF archive in the same manner as option # 1!
If you do not want to include a large list of files that can not be used, you can instead depend on your MATLAB code You can try to use the function to get a list of. After this you can find specific code processing toolbox from this list, which uses your code and compile only when you are asking specifically, it includes mentioning an .mex file: < / P>
mcc ... - an imreconstructmex.mexw32% for # 32-bit Windows mex file
Note: One has come to me (which you need to see a login) that in R2009b some image processing toolbox functions on Windows Abuse, the applications mentioned problem to compile. The above link is an alternative solution. This bug is fixed in the form of R2010a.
Comments
Post a Comment