Header Files.
Posted: Thu Jan 27, 2005 2:36 am
Hi,
I'm not a C programmer and thought some ps2 dev would be the most interesting way to get into it (my last involvement in anything like this was 68000) so apologies for the v.basic question .....
I took the ee samples hello.c and compiled it using make.
Just to feel my way around i added
#include <config.h>
and the following code:
s32 a;
a = configGetLanguage();
sio_printf("Hello from EE SIO! %d\n",a);
All still compiling fine.
Now, i add a reference to the libpad header file which is in the same folder as the config header file.
#include <libpad.h>
int b;
b = padInit(0);
and get the following problem......
ee-gcc -D_EE -O2 -G0 -Wall -IC:\PS2Dev\gcc/ee/include -IC:\PS2Dev\gcc/ee/lib/gc
c-lib/ee/3.2.2/include -IC:\PS2Dev\gcc/ee/ee/include -IC:\PS2Dev\ps2lib/ee/inclu
de -IC:\PS2Dev\ps2lib/common/include -I. -c hello.c -o hello.o
ee-gcc -TC:\PS2Dev\ps2lib/ee/startup/linkfile -LC:\PS2Dev\ps2lib/ee/lib \
-nostartfiles C:\PS2Dev\ps2lib/ee/startup/crt0.o \
hello.o -lkernel -o hello.elf
hello.o(.text+0x3c): In function `main':
hello.c: undefined reference to `padInit'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
Help???
I'm not a C programmer and thought some ps2 dev would be the most interesting way to get into it (my last involvement in anything like this was 68000) so apologies for the v.basic question .....
I took the ee samples hello.c and compiled it using make.
Just to feel my way around i added
#include <config.h>
and the following code:
s32 a;
a = configGetLanguage();
sio_printf("Hello from EE SIO! %d\n",a);
All still compiling fine.
Now, i add a reference to the libpad header file which is in the same folder as the config header file.
#include <libpad.h>
int b;
b = padInit(0);
and get the following problem......
ee-gcc -D_EE -O2 -G0 -Wall -IC:\PS2Dev\gcc/ee/include -IC:\PS2Dev\gcc/ee/lib/gc
c-lib/ee/3.2.2/include -IC:\PS2Dev\gcc/ee/ee/include -IC:\PS2Dev\ps2lib/ee/inclu
de -IC:\PS2Dev\ps2lib/common/include -I. -c hello.c -o hello.o
ee-gcc -TC:\PS2Dev\ps2lib/ee/startup/linkfile -LC:\PS2Dev\ps2lib/ee/lib \
-nostartfiles C:\PS2Dev\ps2lib/ee/startup/crt0.o \
hello.o -lkernel -o hello.elf
hello.o(.text+0x3c): In function `main':
hello.c: undefined reference to `padInit'
collect2: ld returned 1 exit status
make: *** [hello.elf] Error 1
Help???