Thread Subject: Invalid MEX-file Error

Subject: Invalid MEX-file Error

From: Marco Digiacomo

Date: 8 Feb, 2008 10:41:03

Message: 1 of 10

Hello

I have a problem with matlab 2007b.

When I try to execute a function that use a DLL file, this
error message appears:

??? Invalid MEX-file 'C:\mytoolbox\my2text.dll':
C:\mytoolbox\my2text.dll is not a valid Win32 application.

This error wasn't appear with Matlab 7.0

What's the problem?

Subject: Invalid MEX-file Error

From: Gadi Reinhorn

Date: 8 Feb, 2008 16:01:31

Message: 2 of 10

Marco,

This is not an error issued by MATLAB. It is a system error. A quick
google search found:
http://www.computerhope.com/issues/ch000726.htm

It's likely something wrong with the file and or your system. Are you on a
different architecture?

You can find more clues by using the dependency walker tool described in:
http://www.mathworks.com/support/solutions/data/1-2RQL4L.html

Good luck,
Gadi


"Marco Digiacomo" <manduriomane@mathworks.com> wrote in message
news:fohbjv$265$1@fred.mathworks.com...
> Hello
>
> I have a problem with matlab 2007b.
>
> When I try to execute a function that use a DLL file, this
> error message appears:
>
> ??? Invalid MEX-file 'C:\mytoolbox\my2text.dll':
> C:\mytoolbox\my2text.dll is not a valid Win32 application.
>
> This error wasn't appear with Matlab 7.0
>
> What's the problem?


Subject: Invalid MEX-file Error

From: Marco Digiacomo

Date: 8 Feb, 2008 19:43:01

Message: 3 of 10

Hi Gadi

on my PC I have installed both version of Matlab: 7.0 and
7.5.

When I use the DLL file with Matlab 7.0 the function that
use this library is performed correctly.

Intstead, when I use this library with Matlab 7.5, the
error message appears.

Subject: Invalid MEX-file Error

From: Marco Digiacomo

Date: 9 Feb, 2008 12:11:02

Message: 4 of 10

Help me!

Subject: Invalid MEX-file Error

From: Scott

Date: 16 Apr, 2008 13:12:02

Message: 5 of 10

"Marco Digiacomo" <manduriomane@mathworks.com> wrote in
message <foibc5$p9e$1@fred.mathworks.com>...
> Hi Gadi
>
> on my PC I have installed both version of Matlab: 7.0 and
> 7.5.
>
> When I use the DLL file with Matlab 7.0 the function that
> use this library is performed correctly.
>
> Intstead, when I use this library with Matlab 7.5, the
> error message appears.

I have experienced a similar problem. Hopefully someone
knows how to resolve this issue.

Subject: Invalid MEX-file Error

From: Scott

Date: 16 Apr, 2008 13:12:03

Message: 6 of 10

"Marco Digiacomo" <manduriomane@mathworks.com> wrote in
message <foibc5$p9e$1@fred.mathworks.com>...
> Hi Gadi
>
> on my PC I have installed both version of Matlab: 7.0 and
> 7.5.
>
> When I use the DLL file with Matlab 7.0 the function that
> use this library is performed correctly.
>
> Intstead, when I use this library with Matlab 7.5, the
> error message appears.

I have experienced a similar problem. Hopefully someone
knows how to resolve this issue.

Subject: Invalid MEX-file Error

From: Gadi Reinhorn

Date: 16 Apr, 2008 16:34:47

Message: 7 of 10

Marco and Scott,

Can you report what results you have found from your use of the dependency
walker?

There are many reasons this may have happened. We publish some that we know
about in our release notes:
http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bq80uxu-1.html
You might have to look through the all releases we have had between 7.0 and
7.5 to find the reason.

As a note, we try our best to maintain binary compatibility of MEX-files for
several releases. Unfortunately, this is not always possible. We recommend
that you rebuild your MEX-files for every new release of MATLAB to ensure
that they will continue working.

Gadi



"Marco Digiacomo" <manduriomane@mathworks.com> wrote in message
news:foibc5$p9e$1@fred.mathworks.com...
> Hi Gadi
>
> on my PC I have installed both version of Matlab: 7.0 and
> 7.5.
>
> When I use the DLL file with Matlab 7.0 the function that
> use this library is performed correctly.
>
> Intstead, when I use this library with Matlab 7.5, the
> error message appears.


Subject: Invalid MEX-file Error

From: Yong Huang

Date: 17 Sep, 2008 19:08:03

Message: 8 of 10

Have you tried to rebuild the C code in matlab?
mex your_c_file.c

> "Marco Digiacomo" <manduriomane@mathworks.com> wrote in message
> news:foibc5$p9e$1@fred.mathworks.com...
> > Hi Gadi
> >
> > on my PC I have installed both version of Matlab: 7.0 and
> > 7.5.
> >
> > When I use the DLL file with Matlab 7.0 the function that
> > use this library is performed correctly.
> >
> > Intstead, when I use this library with Matlab 7.5, the
> > error message appears.
>
>

Subject: Invalid MEX-file Error

From: Joaquim Luis

Date: 17 Sep, 2008 20:56:03

Message: 9 of 10

"Gadi Reinhorn" <greinhor@mathworks.com> wrote in message <fu59r8$3kq$1@fred.mathworks.com>...
> Marco and Scott,
>
> Can you report what results you have found from your use of the dependency
> walker?
>
> There are many reasons this may have happened. We publish some that we know
> about in our release notes:
> http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bq80uxu-1.html
> You might have to look through the all releases we have had between 7.0 and
> 7.5 to find the reason.
>
> As a note, we try our best to maintain binary compatibility of MEX-files for
> several releases. Unfortunately, this is not always possible. We recommend
> that you rebuild your MEX-files for every new release of MATLAB to ensure
> that they will continue working.
>
> Gadi

Gadi,

As another note and if you forgive my rudeness I find that recommendation totally unaceptable. TMW should try harder to maintain mex compatibility. You see, when we share mexs between users it's just crazy the idea that one should create as many mex as Matlab versions (2 per year now) so that one of them is the right one to a particular user.

J. Luis

Subject: Invalid MEX-file Error

From: Matt Fig

Date: 18 Sep, 2008 01:51:01

Message: 10 of 10

I am not sure if this applies to this situation or not, but a couple versions ago Matlab changed the mex-file extension from .dll to .mexw32. Simply changing the extension might not work. You will probably have to recompile.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com