Linking Lib

Post Reply
azenris
Posts: 16
Joined: Thu Nov 26, 2009 5:44 pm

Linking Lib

Post by azenris » Thu Nov 26, 2009 5:53 pm

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!

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Linking Lib

Post by vuurrobin » Thu Nov 26, 2009 7:43 pm

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.

azenris
Posts: 16
Joined: Thu Nov 26, 2009 5:44 pm

Re: Linking Lib

Post by azenris » Thu Nov 26, 2009 8:18 pm

Thanks that worked :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests