Newsgroups: comp.sys.next
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!stanford.edu!CAMIS.STANFORD.EDU!lane
From: lane@CAMIS.STANFORD.EDU (Christopher D. Lane)
Subject: Re: Using c++
Message-ID: <CMM.0.88.672470574.lane@camis.Stanford.EDU>
Sender: news@shelby.stanford.edu (USENET News System)
Organization: Internet-USENET Gateway at Stanford University
Date: 24 Apr 91 05:22:54 GMT
Lines: 26

>In article <h+9Gak1x1@cs.psu.edu> melling@cs.psu.edu (Michael D Mellinger)
writes:
>In article <1991Apr24.012912.20557@cs.umn.edu> kirchner@umn-cs.cs.umn.edu
(Roger B. Kirchner) writes:
>>
>>   I've just tried using cc++ and am finding that it
>>   chokes on stdio.h:
>>   /usr/include/stdio.h:75: parse error before `new'
>>
>Copy stdio.h to a directory of your own.  Put an underscore in front
>of new to give you _new.  Then add the -Idirectory option to CFLAGS
>(in the makefile) to include the directory where you put stdio.h.
>
>BTW, the problem is new is a reserved word in C++.

Another, more generally accepted, and tested solution is to enclose
the #include/#import in a C++ style 'extern' statement:

	extern "C"
	{
	#import <stdio.h>
	}

other useful 'extern' environment is "Objective-C".

- Christopher
