Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Simple Compiler Issues

Subject: Simple Compiler Issues

From: Andy

Date: 21 Apr, 2009 17:36:02

Message: 1 of 2

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

Subject: Simple Compiler Issues

From: Titus

Date: 22 Apr, 2009 08:11:09

Message: 2 of 2


"Andy " <ahunsberger@miti.cc> schrieb im Newsbeitrag
news:gsl062$h1l$1@fred.mathworks.com...
> 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

Hi,
you need to install those libraries on the deployment machine. There is a
chapter in the doc describing this. In MATLAB\toolbox\compiler\win32 (or
similar) should be a file mglInstaller.exe. Run this on the machine where
you want to run the compiled application.

Titus

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us