delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/18/14:45:10

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Lilja <mindcooler AT gmail DOT com>
Subject: Re: C++ name with leading underscore character not Compiling
Date: Mon, 16 Apr 2007 14:58:51 +0200
Lines: 88
Message-ID: <evvrsk$cvl$1@sea.gmane.org>
References: <1cbe225f0704160234u24b104a5o9b459178e895a5a8 AT mail DOT gmail DOT com> <1cbe225f0704160341o5587b102m665ede86190ba174 AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
In-Reply-To: <1cbe225f0704160341o5587b102m665ede86190ba174@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Chelton Evans skrev:
> Thanks for the language correction. However the compiler is braking.
> Here is some of the code and the error messages reported in compilation.
> 
> I have tested this on two different computers and the same error 
> messages were
> reported.  When I changed the _N to N or something else the
> compilation continued
> on to the next error. Hence it is an underscore problem.
> 
> g++ -Wall -I. -I../misclib/ -I../graphicslib/ -I../mathlib/  -c
> ../graphicslib/graphmisc.cpp
> In file included from ../graphicslib/graphmisc.cpp:3:
> ../graphicslib/graphmisc.h:561: error: expected `,' or `...' before
> numeric constant
> ../graphicslib/graphmisc.h:570: error: expected `,' or `...' before
> numeric constant
> ../graphicslib/graphmisc.h:574: error: expected `,' or `...' before
> numeric constant
> ../graphicslib/graphmisc.cpp:232: error: expected `,' or `...' before
> numeric constant
> ../graphicslib/graphmisc.cpp:256: error: expected `,' or `...' before
> numeric constant
> ../graphicslib/graphmisc.cpp: In constructor
> `gobjMyCircle::gobjMyCircle(doublec, doublec, doublec, uintc)':
> ../graphicslib/graphmisc.cpp:258: error: default argument missing for
> parameter 4 of `gobjMyCircle::gobjMyCircle(doublec, doublec, doublec,
> uintc)'
> ../graphicslib/graphmisc.cpp: At global scope:
> ../graphicslib/graphmisc.cpp:299: error: expected `,' or `...' before
> numeric constant
> make: *** [graphmisc.o] Error 1
> 
> 
> 
> /*!
> \brief Sampled circle or ellipse.
> 
> This can be used in drawing circles of different sizes
> by gobjMyCircleDraw .
> */
> class gobjMyCircle : public gobj
> {
> public:
> 
>  /** The number of sampled points. */
>  uintc N;
> 
>  /** The samples x values. */
>  float * const ptx;
>  /** The samples y values. */
>  float * const pty;
> 
>  /** General arcs can be created by changing the angle
>     interval [theta0,theta1].  Ellipses can be made
>     by changing the axis lengths.
>   */
>  gobjMyCircle
>  (
>    doublec theta0,
>    doublec theta1,
>    doublec xaxislength,
>    doublec yaxislength,
>    uintc _N=360
>  );
> 
>  /** Create an arc. */
>  gobjMyCircle
>  (
>    doublec theta0,
>    doublec theta1,
>    doublec radius=1.0,
>    uintc _N=360
>  );
> 
> Thanks for your response, I will think twice before using an
> underscore, even though
> I do no agree with it being reserved. It is very important to have
> programs that
> compile across other platforms.

And since you think this is important (and I agree), why on earth are 
you trying to use reservered names that will not benefit this 
portability which you seek? :P

> 
> Chelton Evans
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019