BU CAS CS 113
Introduction to Computer Science II with Intensive C
Fall 1997


Compiler Errors FAQ


Last Modified: Mon Nov 17 00:30:47 1997

Q. I keep on getting this message when I compile...and I am sure why...I am especially curious about the 'int' warning at the end. I have checked many times and I don't declare ANYTHING as 'int'

 
 hw3-turtle.c: In function `InitTurtle':
 hw3-turtle.c:105: warning: implicit declaration of function
 `GetCurrentDirection'
 hw3-turtle.c: At top level:
 hw3-turtle.c:200: warning: type mismatch with previous external decl
 hw3-turtle.c:105: warning: previous external decl of `GetCurrentDirection'
 hw3-turtle.c:200: warning: type mismatch with previous implicit
 declaration
 hw3-turtle.c:193: warning: previous implicit declaration of
 `GetCurrentDirection'
 hw3-turtle.c:200: warning: `GetCurrentDirection' was previously implicitly
 declared to return `int'

A. Implicit means you did not provide a prototype. Did you remember to include hw3-turtle.h ?

int is the default return type of a function without prototype. (this is why main() doesn't need a prototype, by the way.)


Q. Every time I type in:

  
 gccx -o hw2-util hw2-util.c hw2-util.h
or the same command for stats I get:
 
 gcc: compilation of header file requested. 
I cannot figure out why it is doing this. Do you know what would cause this?

A. I have tried to make your life easy by providing the Makefile, please use it. Type 'make -k' and it will do all the compiling you need.

The reason this doesn't work is that (1) the logic is not quite correct and (executables are made from the object files--see the examples in the Makefile) and (2) hw2-util is not a stand alone program, so you can't make an executable called hw2-util.

The same goes for stats. Those two packages will be combined with some code of mine to make hw2-histogram.


Q. I am really not sure why this is happening, or what it means. I have a simple section of code like:

 
 j = GetInteger();
 
I also tried other variables, just to make sure I wan't doing something
 wring with that one.
 
 I always get this error:
 hw2-util.c:47: warning: implicit declaration of function `GetInteger'	
Any ideas?

A. Sounds like a prototype is missing. Did you #include "simpio.h" ?