Path: news.mathworks.com!not-for-mail
From: "Sridhar Mahadevan" <mahadeva@cs.umass.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Mex error in 64-bit 2008a Mac OS X beta
Date: Fri, 25 Jul 2008 00:38:02 +0000 (UTC)
Organization: University of Massachusetts
Lines: 36
Message-ID: <g6b79a$ppa$1@fred.mathworks.com>
References: <g67985$4pk$1@fred.mathworks.com> <488880D4.9090606@mathworks.com>
Reply-To: "Sridhar Mahadevan" <mahadeva@cs.umass.edu>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1216946282 26410 172.30.248.37 (25 Jul 2008 00:38:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 25 Jul 2008 00:38:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1222965
Xref: news.mathworks.com comp.soft-sys.matlab:481712


Brian Arnold <Brian.Arnold@mathworks.com> wrote in message 
<488880D4.9090606@mathworks.com>...
> Hi Sridhar,
> 
> Try the following to diagnose the root cause.
> 
> Run the first g++ command, with ! before the command to escape out to 
> the shell and run it, then run !nm FastGSOGP.o.
> 
> The output of nm should contain a line with "T _mexFunction".  If it 
> does not show up, or if it shows up with lots of characters before and 
> after the name (for example, __Z11mexFunctionsPP11mxArray_tagsPPKS_), 
> then something may be wrong with how it is being declared in the source 
> file FastGSOGP.cpp.
> 
> The declaration in your source file should match the parameter types 
> exactly, like this:
> 
> void mexFunction( int nlhs, mxArray *plhs[],
> 		  int nrhs, const mxArray *prhs[] )
> 
> The integer arguments must be the intrinsic "int" type (without 
> qualifiers), for this signature to work on all platforms.  Use of short 
> or long integer, or other derived types, will cause the signature to 
> fail to be an exact match for certain compilers.
> 
> Brian


Brian, 

Many thanks! You hit the nail on the head. I had to reformat the declaration 
of mexFunction. This now works perfectly.