realbasic-nug
[Top] [All Lists]

Re: Declares different on Win v Mac?

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Declares different on Win v Mac?
From: Ken Mankoff <mankoff at gmail dot com>
Date: Tue, 9 Aug 2005 14:23:19 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=hGGGQqAxhgFIIFw2ARU/ziNgn79ZTAer+uSiiLxlDMEEQsbWNXDx2brOJ6LyXfDW8DvKPiGnr4jSg62XOWXsCwDiopv6QB6QRCuzDZryltBcuUf2mh+1i+6/bdLrcusSWxcQmbhCLUkz61MYo6WM2kDBhPL069es/mZosu9C1o0=
References: <5c8121ef0508091052c482c3d at mail dot gmail dot com> <46ade30920c0f0e7aad61bab085c251c at declareSub dot com>
No, on windows I'm using "c:\EVA\netcdf.dll".
I got the DLL from the netCDF website. I imagine it is the Windows 
counterpart to the mac "libnetcdf.dylib", but could be wrong.

The errors:
err = nc_inq_dim( ncid, dimid, namePtr, length )
nc_inq_dim is highlighted, and RB says, "Parameters are not compatible with 
this function".
The parameters are compatibly on Mac, just not on Windows.

If I change namePtr to something different it still complains, so it isn't a 
variable scope naming conflict.

-k.

On 8/9/05, Charles Yeomans <charles at declaresub dot com> wrote:
> 
> I hope you're not using
> @executable_path/../../lib/netCDF/libnetcdf.dylib to refer to the
> library in Windows builds, as it's probably not likely to work.
> 
> Exactly what complaint does the compiler make? I suppose it's possible
> that it sees a conflict between the use of namePtr as a local variable
> and in the declaration, but I think Rb is now usually okay with that.
> 
> Charles Yeomans
> 
> On Aug 9, 2005, at 1:52 PM, Ken Mankoff wrote:
> 
> > Hi Group,
> >
> > I have some declares I've been using successfully on Mac. I am now
> > porting
> > my app to Windows and the declare statements are producing errors so
> > that my
> > app won't even compile. The library I am linking to is cross platform
> > and
> > has the same function prototypes on both Win and Mac.
> >
> > Here is my mac code:
> >
> >
> > ' library is a constant
> > @executable_path/../../lib/netCDF/libnetcdf.dylib
> > ' the function is: int nc_inq_dim( int ncid, int dimid, char *name,
> > size_t*
> > lengthp );
> >
> > dim ncid, dimid, length as integer
> > dim namePtr as memoryBlock = newMemoryBlock( 32 )
> >
> > soft declare function nc_inq_dim lib library( ncid as integer, dimid as
> > integer, namePtr as ptr, byref length as integer ) as integer
> > dim err as integer = nc_inq_dim( ncid, dimid, namePtr, length )
> >
> > this works fine on Mac. This does not work on windows.
> >
> > The compiler complains about the use of namePtr in the 2nd line (the
> > function call, not the declaration).
> >
> > Any suggestions appreciated.
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>