#136221 - troymclure - Mon Jul 30, 2007 8:25 am
i am trying to create a static library for NDS with devkitARM with no success. For instance let's suppose i want an archive with the C function "int increment (int)"
then i create the file archive.c like this:
int increment (int a) {
return a + 1;
}
so i compile it like this: /home/troymclure/devkitPRO/devkitARM/bin/arm-eabi-gcc
-c archive.c -o archive.o
then i create the archive like this: /home/troymclure/devkitPRO/devkitARM/bin/arm-eabi-ar -r archive.a archive.o
and i got the file archive.a and no errors or warning mesages are issued by arm-eabi-ar and everything looks ok.
then the problem is to tell to the linker to link my library. under linux i just do something like this: gcc my_main_code.o archive.a -o my_program.out
with devkitARM i have to use a makefile and currently i don't uderstand all the sintax of the makefiles under the libnds examples. i just use the makefile of the example ../Graphics/2D/16bit_color_bmp and i just edit it at my purpose, u know, as a template. could please anyone let me know how to edit this template to make the linker link my archive?
then i create the file archive.c like this:
int increment (int a) {
return a + 1;
}
so i compile it like this: /home/troymclure/devkitPRO/devkitARM/bin/arm-eabi-gcc
-c archive.c -o archive.o
then i create the archive like this: /home/troymclure/devkitPRO/devkitARM/bin/arm-eabi-ar -r archive.a archive.o
and i got the file archive.a and no errors or warning mesages are issued by arm-eabi-ar and everything looks ok.
then the problem is to tell to the linker to link my library. under linux i just do something like this: gcc my_main_code.o archive.a -o my_program.out
with devkitARM i have to use a makefile and currently i don't uderstand all the sintax of the makefiles under the libnds examples. i just use the makefile of the example ../Graphics/2D/16bit_color_bmp and i just edit it at my purpose, u know, as a template. could please anyone let me know how to edit this template to make the linker link my archive?