| View previous topic :: View next topic |
| Author |
Message |
darrenjferguson
Joined: 27 Jan 2005 Posts: 6 Location: London/UK
|
Posted: Thu Jan 27, 2005 2:36 am Post subject: Header Files. |
|
|
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??? _________________ Darren |
|
| Back to top |
|
 |
darrenjferguson
Joined: 27 Jan 2005 Posts: 6 Location: London/UK
|
Posted: Thu Jan 27, 2005 2:49 am Post subject: |
|
|
Don't worry,
Got it. had to add this in the makefile.
EE_LIBS = -lpad
don't understand quite why though.
:) _________________ Darren |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Thu Jan 27, 2005 5:43 am Post subject: |
|
|
Including the header only tells the compiler what's inside an external library file. Its basically just a description of the interface/api. You still have to link in that library with -lpad in order to actually use it.
As an aside, is there a reason you're using ps2lib instead of ps2sdk? |
|
| Back to top |
|
 |
|