delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/26/11:07:49

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Subject: RE: MATLAB mexFunction() with Cygwin GCC Windows
MIME-Version: 1.0
Date: Wed, 26 Sep 2007 08:09:39 -0700
Message-ID: <7C82AE18E63BBF46BFAC6364E1E4CA591087FB@nebulasoftware1.NebulaSoftware.com>
In-Reply-To: <Pine.GSO.4.63.0709261021550.16844@access1.cims.nyu.edu>
References: <7C82AE18E63BBF46BFAC6364E1E4CA591087EE AT nebulasoftware1 DOT NebulaSoftware DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0709261021550 DOT 16844 AT access1 DOT cims DOT nyu DOT edu>
From: "Boyd Edmondson" <BoydEdmondson AT NebulaSoftware DOT COM>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l8QF7ci8016765

Done.  Thanks.

Boyd
-----Original Message-----
From: Igor Peshansky [mailto:pechtcha AT cs DOT nyu DOT edu] 
Sent: Wednesday, September 26, 2007 7:24 AM
To: Boyd Edmondson
Cc: cygwin AT cygwin DOT com
Subject: Re: MATLAB mexFunction() with Cygwin GCC Windows

On Wed, 26 Sep 2007, Boyd Edmondson wrote:

> I have successfully built/linked MATLAB mex files on Windows using GCC
> in Cygwin.  Unfortunately, it has a runtime error.  It appears the error
> is due to mismatched calling coventions for parameter passing.  The
> MATLAB interpreter successfully invokes the mexFunction() in my shared
> library (.mexw32), but the passed parameters are "corrupted".
>
> I've tried GCC's "attribute" to set the mexFunction() to "cdecl",
> "stdcall", and "fastcall", but still no luck.
>
> Anyone know the solution?
>
> Details follow:
>
> MATLAB mexopts.bat
> =================
> [snip]
> set COMPILER=gcc
> set COMPFLAGS=-mno-cygwin -D_WIN32 -shared -DMATLAB_MEX_FILE -Wall -c -msse3 -I"%ProgramFiles%\Pthreads\include" -I"%ProgramFiles%\Verasonics\Hal\Hal C\Includes" -o%MEX_NAME%.obj
                ^^^^^^^^^^^
> set LINKER=gcc
> set LINKFLAGS=-mno-cygwin -D_WIN32 -shared -DMATLAB_MEX_FILE -nostartfiles -L"%ProgramFiles%\Verasonics\Hal\Hal C\Shared Libraries" -lverasonicshalwindows -L"%ProgramFiles%\MATLAB\R2007a\bin\win32" -lmat -lmex -lmx
                ^^^^^^^^^^^
See the underlined portions above.  You're not using the Cygwin gcc,
you're really using the MinGW gcc that understands Cygwin paths.  So
you're better off asking on the MinGW list.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Belief can be manipulated.  Only knowledge is dangerous.  -- Frank Herbert

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019