Article View: gnu.g++.help
Article #810Re: New user libg++ problem
From: Rusty, Paul , Russell
Date: Wed, 01 Nov 1995 01:56
Date: Wed, 01 Nov 1995 01:56
23 lines
1363 bytes
1363 bytes
In message <icfgisDHBr4p.J6q@netcom.com> you write:
> This test, cribbed from the hylafax configure script, fails:
>
> int main(){ int* a = new int; *a = 0; delete a; return 0;}
>
> floyd2.c: In function `main':
> floyd2.c:1: `new' undeclared (first use this function)
> floyd2.c:1: (Each undeclared identifier is reported only once
> floyd2.c:1: for each function it appears in.)
> floyd2.c:1: parse error before `int'
> floyd2.c:1: parse error before `a'
Hi Charlie,
Your problem in this case is that gcc is treating floyd2.c as a
CF (not a C++) file. There are two ways to get around this: rename floyd2.c
to floyd2.cc, or specify `-x c++' as an option to gcc.
Hope this helps,
Rusty.
--
Rusty.Russell@adelaide.maptek.com.au "Engineer? So you drive trains?"
DO NOT BEND, FOLD OR MUTILATE IN ANY WAY THIS SCREEN. #include <stddisclm.h>
Technical Details
Message-ID:
<199511010146.MAA10225@gauss.adelaide.maptek.com.au>Path:
arc1-ca.pugleaf.net!adelaide.maptek.com.au!Rusty.RussellReferences:
<icfgisDHBr4p.J6q@netcom.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!adelaide.maptek.com.au!Rusty.Russell From: Rusty.Russell@adelaide.maptek.com.au (Rusty, Paul , Russell) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: Re: New user libg++ problem Date: 31 Oct 1995 20:56:27 -0500 Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu Sender: daemon@cis.ohio-state.edu Distribution: world Message-ID: <199511010146.MAA10225@gauss.adelaide.maptek.com.au> References: <icfgisDHBr4p.J6q@netcom.com>