Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Compiling pnet with mex
Date: Tue, 13 May 2008 20:09:49 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 28
Message-ID: <g0csid$7kg$1@canopus.cc.umanitoba.ca>
References: <g0cq9n$k2k$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1210709389 7824 192.70.172.160 (13 May 2008 20:09:49 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Tue, 13 May 2008 20:09:49 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:468241


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