Why do I get an error when trying to compile STRFIND into a stand-alone program using the MATLAB Compiler?

1 view (last 30 days)
Why do I get an error when trying to compile STRFIND into a stand-alone program using the MATLAB Compiler?
When I try to compile a file containing STRFIND into a stand-alone executable using the MATLAB compiler, I get the following message:
Warning: No M-function source available for "strfind", assuming
function [varargout] = strfind(varargin)
NOTE: This will produce a link error in stand-alone code
unless you provide a hand-written definition for this function.
Undefinedfirst referenced
symbol in file
mlfNStrfind test.o
ld: fatal: Symbol referencing errors. No output written to test
mbuild: link of 'test' failed.
??? Error using ==> mbuild
Unable to complete successfully
??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable (specify the -v option for more information).
The simple file that I tried to compile is:
function a = test
b = 'hello';
a = strfind(b,'l')
and I compiled it using MSVC and the following command:
mcc -m test.m -v

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is a bug in the MATLAB Compiler 2.2 (R12.1) that has been fixed in the MATLAB Compiler 3.0 (R13).
For previous versions, please try using the FINDSTR function rather than STRFIND. Documentation on FINDSTR can be found by typing the following at the MATLAB Command Prompt:
doc findstr

More Answers (0)

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!