Page 1 of 1

Linking Lib

Posted: Thu Nov 26, 2009 5:53 pm
by azenris
Hi, I'm having trouble linking a library I made. I used the example folder to create the lib. he output is a .a file, named "libNexlib.a" the lib prefix was automatic.

* I placed the .a file into a folder called lib including all the header files.
* I placed the lib folder into the arm9 folder. (im using a combined template)
* I changed

Code: Select all

LIBS := -lfat -lmm9 -lnds9
to

Code: Select all

LIBS := -lNexlib -lfat -lmm9 -lnds9"
* I changed

Code: Select all

LIBDIRS := $(LIBNDS)
to

Code: Select all

LIBDIRS := $(LIBNDS) ../lib
* I tried different ways for the LIBDIR

My error is

Code: Select all

1>c:/devkitpro/devkitarm/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld.exe: cannot find -lNexlib
How do I add a lib. Have a missed a step or doing something wrong above. Any help appreciated!

Re: Linking Lib

Posted: Thu Nov 26, 2009 7:43 pm
by vuurrobin
the libNexlib.a file should be in 'somedir/lib', the includes in 'somedir/include' and you need to add somedir to the libdirs. It doesn't matter how somedir is called, as long as it has a lib and include folder in it.

Re: Linking Lib

Posted: Thu Nov 26, 2009 8:18 pm
by azenris
Thanks that worked :)