|
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 ‘newbuffsize’:
> >pnet.c:225: error: expected expression before ‘/’ 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
|