フィルターのクリア

How to create an executable using mcc for with multiple mex files?

3 ビュー (過去 30 日間)
Ramaprasad Kulkarni
Ramaprasad Kulkarni 2013 年 6 月 17 日
Hi All,
I want to generate a standalone executable for a mix of Matlab '.m' file and 'mex' files (with mexfunction in each of them). I used 'mcc' tool for this with the syntax:
>> mcc -o PMIA -W WinMain:PMIA -T link:exe -v PMIA.m anisodiff3d.c anisodiff3d8.c
The above command runs good until it throws a linker error:
anisodiff3d8.obj : error LNK2005: mexFunction already defined in anisodiff3d.obj LINK : fatal error LNK1561: entry point must be defined
Essentially it says that mexFunction is redefined in the second C mex-file. It is necessary for each of the C file to be a mex-file so I can call them in Matlab and so should have a mexFunction in them, which in turn leads to the above linker error (to my understanding). Can anyone please suggest a solution or workaround for my issue?
-- Thanks in advance, Ram.

採用された回答

Kaustubha Govind
Kaustubha Govind 2013 年 6 月 17 日
If PMIA.m already calls into the MEX-files, I think MATLAB Compiler should package the compiled MEX-files automatically into your executable, you shouldn't have to add the source files to the end of the command.

その他の回答 (1 件)

Ramaprasad Kulkarni
Ramaprasad Kulkarni 2013 年 6 月 17 日
Thanks a lot Kaustubha for your reply, the issue is resolved :)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by