#25810 - hakanyuksel - Sat Aug 28, 2004 10:56 pm
I am using HAM. I have several c files in my project. I have a problem with calling functions from other c files. my code is like this
this is the main c file:
this it the header of the init.c file
and this is the init.c file
when i compile the project I have an error like this
main.o(.text+0x1c): In function `main':
: undefined reference to `init_game()'
make: *** [engine.elf] Error 1
What am i doing wrong. Why the compiler cant find the init_game procedure. it is declared in the init.h header file....
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com
this is the main c file:
Code: |
#include <math.h> #include "variable.h" #include "interrupt.h" #include "init.h" int main(void) { init_game(); while(1) { } return(0); } |
this it the header of the init.c file
Code: |
void init_game(); |
and this is the init.c file
Code: |
#include "variable.h" #include "data.h" #include "display.h" #include "sprites.h" #include "init.h" void init_game() { // init_vars(); copy_data_to_vram(); u16 counter=0; // SPRITE lar sifirlanir for(counter=0;counter<128;counter++) { sprite_attributes[counter].attribute1 = 160; sprite_attributes[counter].attribute2 = 240; sprite_attributes[counter].attribute3 = 0; } set_video_mode( MODE_0 | SPRITES | SPR_1D | BG0 ); BG0_SET = 128+512+1024+2048+4096; // init_objects(); // write_number_16_bg0(65535,1,1,32); } |
when i compile the project I have an error like this
main.o(.text+0x1c): In function `main':
: undefined reference to `init_game()'
make: *** [engine.elf] Error 1
What am i doing wrong. Why the compiler cant find the init_game procedure. it is declared in the init.h header file....
_________________
--------------------
Hakan Yuksel
3TE GAmes
www.3tegames.com