Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe25.iad.POSTED!f8a62740!not-for-mail
From: Geico Caveman <spammers-go-here@spam.invalid>
Organization: Some
Newsgroups: comp.soft-sys.matlab,comp.lang.fortran
Message-ID: <2009102113274275249-spammersgohere@spaminvalid>
References: <2009102112385016807-spammersgohere@spaminvalid>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Subject: Re: mxGetNumberOfDimensions missing ?
User-Agent: Unison/1.8.1
Lines: 63
X-Complaints-To: abuse@teranews.com
NNTP-Posting-Date: Wed, 21 Oct 2009 20:27:42 UTC
Date: Wed, 21 Oct 2009 13:27:42 -0700
Xref: news.mathworks.com comp.soft-sys.matlab:579098 comp.lang.fortran:213039


On 2009-10-21 12:38:50 -0700, Geico Caveman 
<spammers-go-here@spam.invalid> said:

> Mac OSX 10.5.6
> Matlab R2009a
> 
> gfortran/gcc
> 
> Code fragment:
> 
> subroutine mexFunction(nlhs, plhs, nrhs, prhs)
>   use matlabmex
> 
>   implicit none
>     integer, intent(in) :: nlhs, nrhs
>   integer, intent(in), dimension(:), pointer :: prhs
>   integer, intent(out), dimension(:), pointer :: plhs
> 
>   integer(i4b) :: l,m,n
>   integer(i4b), pointer :: n1
>   integer(i4b), pointer :: A
>     if(nrhs /= 2) then
>      call mexErrMsgTxt('Function requires four input arguments.');
>   end if
>     A = mxGetData(prhs(1))         n1 = mxGetDimensions(prhs(1))
>    end subroutine mexFunction
> 
> 
> matlabmex.f90 contains:
> 
> integer (kind=4) function mxGetData(pm)
>      use constants      integer (kind=4)  :: pm
>    end function mxGetData
> 
>    integer (kind=4) function mxGetDimensions(pm)
>      use constants      integer (kind=4)  :: pm
>    end function mxGetDimensions
> 
>    integer(kind=4) function mxGetNumberOfDimensions(pm)
>      use constants
>      integer(kind=4) :: pm
>    end function mxGetNumberOfDimensions
> 
> in the interface block.
> 
> Compilation:
> 
> /Applications/MATLAB2009a/MATLAB_R2009a.app/bin/mex -maci mexFunction.f90
> Undefined symbols:
>   "_mxgetdimensions_", referenced from:
>       _mexfunction_ in mexFunction.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> 
>     mex: link of ' "mexFunction.mexmaci"' failed.
> 
> It can find mxGetData() but not mxGetNumberOfDimensions()
> 
> I have checked my matlab documentation to confirm that the function exists.

I posted the error and code fragment regarding mxgetdimensions. I have 
the same problem with that mex command.