Mail Archives: djgpp/1997/02/07/03:10:25
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 <stdlib.h>.
>
>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
- Raw text -