On Fri, Mar 27, 2009 at 2:29 AM, Chris Robson
<clr1004@xxxxxxxxxxx> wrote:
I am trying to create a linked library (Sofia-SIP libraries) within the
./petalinux-dist/lib tree. When trying to link to those libraries it
errors out with undefines (see below). Using mb-linux-nm shows the
modules are there (see below). Following is the makefile.
thanks for the help.............chris
make ERRORS.............
mb-linux-gcc -L/petalinux-dist/lib/sofia-sip/libsofia-sip-ua/.libs \
-lsofia-sip-ua -lpthread -o responder -I/usr/include \
-g -Wall inflight.o handlers.o hash.o config.o responder.c
In file included from responder.c:8:
/usr/include/pthread.h:653: warning: ‘__regparm__’ attribute directive
ignored
/tmp/ccxVGAQt.o: In function `EventCallBack':
/petalinux-dist/user/responder/responder.c:220: undefined reference to
`su_root_break'
Try putting the the -lsofia-sip-ua parameter at the end of the gcc commandline, rather than the beginning. Here's results from my trivial test:
# -llib early in the commandline - bad
[jwilliams@g613-9373 libfoo]$ gcc -L . -llib -o main main.c
main.c: In function ‘main’:
main.c:4: warning: return type of ‘main’ is not ‘int’
/tmp/ccqaBgG7.o: In function `main':
main.c:(.text+0x12): undefined reference to `libfunc'
collect2: ld returned 1 exit status
#-llib late in the commandline - good
[jwilliams@g613-9373 libfoo]$ gcc -L . -o main main.c -llib
main.c: In function ‘main’:
main.c:4: warning: return type of ‘main’ is not ‘int’
Regards,
John
--