Path: news.mathworks.com!not-for-mail
From: "Peter " <pneilley@wsi.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Compiling pnet with mex
Date: Wed, 14 May 2008 00:53:02 +0000 (UTC)
Organization: Weather Service International
Lines: 44
Message-ID: <g0dd5e$i27$1@fred.mathworks.com>
References: <g0cq9n$k2k$1@fred.mathworks.com> <g0csid$7kg$1@canopus.cc.umanitoba.ca>
Reply-To: "Peter " <pneilley@wsi.com>
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 1210726382 18503 172.30.248.37 (14 May 2008 00:53:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 May 2008 00:53:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 14174
Xref: news.mathworks.com comp.soft-sys.matlab:468275


Thanks Walter,  That did the trick.  Although I couldn't
figure out how to get the mex compiler to run gcc4 allowing
the extended comment syntax "//", I just edited the source
code to change all comments to standard C comment syntax
("/*... */").  That did the trick.  All the other errors
reported by the compiler (that at first glance seemed
unrelated to the comment issue) were resolved. 

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g0csid$7kg$1@canopus.cc.umanitoba.ca>...
> In article <g0cq9n$k2k$1@fred.mathworks.com>, Peter 
<pneilley@wsi.com> wrote:
> >I am trying to build the pnet package (tcp_dup_ip) using
> >mex.  I'm running 64bit linux and hence the supplied
> >pnet.mexglx does not work.
> 
> >I have gcc 4.2.0 installed.  When I run mex on pnet.c I get
> >alot of errors (see below).  If I compile with the "CC=G++"
> >option, less errors, but still alot. I suspect I'm doing
> >something wrong since no one else has mentioned trouble
> >compiling this package that I can find.
> 
> >> mex -O pnet.c
> >pnet.c: In function &#8216;newbuffsize&#8217;:
> >pnet.c:225: error: expected expression before &#8216;/&#8217; token
> 
> When you get lots of complaints about expecting an expression
> before a / token, then the problem is almost certainly
that you
> have used a C89 compliant compiler to attempt to compile code
> that uses // style comments. // style comments were not
made an
> official part of C until C99, but they are a common extension.
> gcc will normally allow them even in C89 mode unless options
> have been passed to gcc telling it to be very strict.
> 
> C++ has included // style comments for much longer, so
when you
> compile with G++ the problems with those comments go away.
> -- 
>   "Not the fruit of experience, but experience itself, is
the end."
>                                               -- Walter Pater