Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Simple Compiler Issues
Date: Tue, 21 Apr 2009 17:36:02 +0000 (UTC)
Organization: MiTi
Lines: 36
Message-ID: <gsl062$h1l$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240335362 17461 172.30.248.38 (21 Apr 2009 17:36:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Apr 2009 17:36:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1185081
Xref: news.mathworks.com comp.soft-sys.matlab:534457


I'm having trouble creating a stand-alone EXE file from an m-file with Matlab Compiler.  I can successfully create a stand-alone exe file from an m-file, but it only runs on the computer that i used to run the compiler.  It does not work on any other computer.

This is the command I use...
">> mcc -m sagittafinder"

This is the error that occurs on other computer....
"Unable to Locate Component - This application has failed to start because libmat.dll was not found.  Re-installing the application max fix this problem.

It does work great on my PC only.  This is the versions of Matlab and compiler that I'm using on a Dell desktop with Windows XP SP2

Matlab Version 6.5.2.202935 Release 13 (Service Pack 2)
MCC MATLAB to C/C++ Compiler (Version 3.0)

And here is my code. I've been searching but most issues on this forum are much more complicated, so i'm optimistic that someone here can help me.

function sagittafinder
clear
n = 'y';

while strcmp(n,'y') | strcmp(n,'Y');
    clc
    D = input('Enter Diameter (in): ');
    M = input('Enter Area (in2): ');
    R = D/2;
    A = pi*R^2;
    K = A - M;
    h2 = 0;
    Kg = 0;
    while Kg < K
        h2 = h2 + 0.001;
        Kg = (D/2)^2*acos((R-h2)/R)-(R-h2)*sqrt(2*R*h2-h2^2);      
    end  
    disp(sprintf('The Area Check is %g',A - Kg))
    disp(sprintf('The Height is %g',h2))
    n = input('Run Again? ','s');
end