From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble with C++ and interrupt Date: Thu, 11 Dec 1997 20:56:41 -0600 Organization: Southwest Missouri State University Lines: 32 Message-ID: <3490A7E9.27D2@nic.smsu.edu> References: <3490359E DOT 3883 AT mbox5 DOT swipnet DOT se> Reply-To: aho450s AT nic DOT smsu DOT edu NNTP-Posting-Host: sara.a25.smsu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Thomas Larsson wrote: > void main(void) > { > cout << "HI!"; > } I just thought I'd get to one of these before John does -smile-. void is not a valid return type for main(). main() must always return an integer: int main(void) for example. > > I wrote "gcc test.cpp -o test.exe" > What could be wrong? Have you downloaded the files needed to compile C++ code? Assuming you have, gcc doesn't automatically link the C++ libraries. The simplest solution is to compile with gxx rather than gcc. gxx automatically links the correct C++ library. > I have also tried to compile some examples for multiple keypresses. They > all include a keyword called "interrupt" but DJGPP doesn't find it > anywhere. Should I replace it or should I use another keyword? I think (but am not certain) that interrupt is a non-standard extension that some compiler makers include to facilitate writing interrupt handlers. > Thanks for your help, I have looked through the FAQ but I can't find any > answers to the problems there... Section 8.7 of the FAQ discusses the C++ question.