Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Errors during mex compilation on certain systems
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rune Allnor  
View profile  
 More options Jan 23 2010, 5:11 pm
Newsgroups: comp.soft-sys.matlab
From: Rune Allnor <all...@tele.ntnu.no>
Date: Sat, 23 Jan 2010 14:11:25 -0800 (PST)
Local: Sat, Jan 23 2010 5:11 pm
Subject: Re: Errors during mex compilation on certain systems
On 23 Jan, 18:11, "Kasper Marstal" <lifesucksandthenyou...@gmail.com>
wrote:

> Hello,

> I have a mex c-file that compiles beautifully on my mac and latop, but my Windows 7 x64 system using Microsoft Visual C++ 2008 SP1 throw lots of errors..

You need to take particular care when writing C and C++ programs
that are supposed to be portable. Both languages have a core
that is standardized, and that at leat in principle should
compile on every platform.

However, there are many ways to depart from the standard,
either by leaving out standardized features (or rather,
compiler vendors have not yet implemented recently
standardized features), or by adding platform- or compiler-
specific libraries or features.

There are also variations on how strict any particular
compiler will be with respect to syntax and warnings, etc.

Once you are aware of these kinds of things, there are a
few guidelines you can use to minimize such problems:

1) Strictly stick to standardized C or C++ code. Don't
   use compiler-, OS- or platform-specific libraries,
   as these will get you into trouble when you attempt
   to port.
2) Learn your compiler. Most compilers have switches and
   directives that either disable non-standard features
   and / or forces the compiler to accept only standardized
   code.
3) Compile the same code on several systems and compilers.
   What one compiler accepts, another will reject. Like what
   probably is the case in your code.

In addition, use type declarations like size_t, ptrdiff_t
and so on, instead of int, unsigned int, long int etc.
These are the kinds of things that are almost certain to
cause trouble when porting between platforms.

Rune


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.