From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble with C++ and interrupt Date: Thu, 11 Dec 1997 19:16:31 +0000 Organization: Two pounds of chaos and a pinch of salt Lines: 35 Message-ID: <34903C0F.2F81@cs.com> References: <3490359E DOT 3883 AT mbox5 DOT swipnet DOT se> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp203.cs.com 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: > > Thanks for your help, I have looked through the FAQ but I can't find any > answers to the problems there... Chapter 8.7 discusses your exact problem. It is titled "Unresolved externals when linking programs." This would seem to be a dead giveaway that it can help you solve your problem. :-) C++ uses a different set of libraries than C. The compiler does not automatically link these libraries, so you have to specify them yourself. There are two ways to do so: add "-lgpp" to the end of your command line, or use 'gxx' instead of 'gcc' when compiling C++ programs. > 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? The FAQ also discusses these issues in chapter 18. The "interrupt" keyword is unknown to gcc, and in any case, interrupt handling is substantially different under protected mode than under real mode. Your old code probably wouldn't work anyway even if you did manage to get gcc to recognize that keyword. Please read through chapter 18, and then look through some example DJGPP code that uses interrupt handling, such as the Allegro library or the 'v2tk/mkkbd3.zip' sample program. hth -- --------------------------------------------------------------------- | John M. Aldrich | "Money is truthful. If a man speaks | | aka Fighteer I | of his honor, make him pay cash." | | mailto:fighteer AT cs DOT com | | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------