Mail Archives: djgpp/1997/07/23/03:47:27
I have renamed the TILE, SPRITE and MAP to .C files instead of .H files.
The compiler already has the -c directive, but now 2 other errors occur:
Error: gcc.exe: bwmaped.o: linker input file unused since linking not
done
Error: gcc.exe: -lalleg: linker input file unused since linking not done
Can anybody help???
Andrew Crabtree wrote:
>
> > I'm coding a map editor and I have decided to split my routines into
> > smaller files. This is the list of the current files:
> >
> > - BWMAPED.C (Main program)
> > - DATASTRT.H (Various constants and data structures)
> > - TILE.H (Tile routines)
> > - SPRITE.H (Sprite routines)
> > - MAP.H (Map routines)
> > bwmaped.c(101) Error: undefined reference to 'IMD_new_map'
> >
>
> As a general rule of thumb, only put the following in header files.
>
> Macros
> Defines
> Function Prototypes
> Struct declarations
> Externs
>
> Do NOT put in anything like this
>
> Variable Declaration
> Functions themselves.
>
> When splitting up files make multiple .c files, with corresponding
> .h files describing the interface if needed, to functions and variables.
> Compile the .c files with the -c option to stop at .o phase. Then,
> link them all together at once.
- Raw text -