Hi all!
This is my first post in here. I disliked C for a long time, but now that I'm getting the hang of it, I like to do stuff with it.
I'm getting a 'Implicit declaration of function' warning. This happens usually when the function that is being called is not defined, nor it's prototype.
make all:
Code:
gcc -ansi -pedantic -Wall -c main.c
main.c: In function 'main':
main.c:4: warning: implicit declaration of function 'newGameArea'
main.c:4: warning: initialization makes pointer from integer without a cast
gcc -ansi -pedantic -Wall -c functions.c
gcc -ansi -pedantic -Wall -c gamearea.c
gcc -ansi -pedantic -Wall -c heightmap.c
gcc -ansi -pedantic -Wall -c position.c
gcc -ansi -pedantic -Wall -c tetromino.c
gcc -o "proj2" main.o functions.o gamearea.o heightmap.o position.o tetromino.o
main.c includes it's own header file, main.h
main.h includes every other header file:
Code:
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constants.h"
#include "functions.h"
#include "position.h"
#include "tetromino.h"
#include "heightmap.h"
#include "gamearea.h"
main.c (line 4):
Code:
GameArea *gameArea = newGameArea();
The function that is missing, is prototyped on gamearea.h:
Code:
GameArea* newGameArea();
I'm really clueless on what is going on. I'd appreciate some help
Thanks!
anatoly