From: Eric Rudd Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP is not strict enough ??? Date: 6 Feb 1997 21:57:29 GMT Organization: CyberOptics Corp Lines: 31 Message-ID: <5ddk49$lta@hagar.cyberoptics.com> References: <1997Feb5 DOT 173245 DOT 93344 AT cc DOT usu DOT edu> <855243202 DOT 949118 AT araga DOT funcom DOT com> NNTP-Posting-Host: rudd.cyberoptics.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 kurt DOT skauen AT funcom DOT com (Kurt Skauen) wrote: >slsyj AT cc DOT usu DOT edu (CHRISTINA) wrote: > >>I am a beginning C++ programmer and I just >>started to use djgpp. Now, I have one tiny >>problem. Is there anyway I can force djgpp >>to check if I've included the necessary >>libraries? The problem is that the person >>who grades my homework uses Borland C++ (don't >>mean to continue the flame war here) so if >>I use an exit statement in my program, Borland's >>compiler will protest whereas dgjpp compiles and >>runs just fine. Still, the grader will dock >>points for a program that does not compile >>without him adding #include . > >If you miss som libraries the linker will complain about unresolved >references when building the executable. What you are missing is only >the header file declaring proto-types for the functions in a library. The -Wall suggestion is certainly helpful in general, but it still won't catch the lack of a prototype for "exit", since certain functions such as "exit", "memcpy", etc. are built into gcc. gcc does not require prototypes for them, which I think is what was getting you into trouble. However, you can defeat this behavior with the -fno-builtin flag. This is documented in the gcc.i2 info file. Hope this helps. -Eric Rudd rudd AT cyberoptics DOT com