Hi everybody,

I'm trying to do a simple thing: compile a library statically and link
to it in uClinux. The library is libcurl and I managed to get it
compiled as a static library using the defaults (didn't modify the
configured Makefile).
In my test program, I try to link to it using the following syntax:

test_program: test_program.o httpslib.o
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ test_program.o httpslib.o
/home/motoct/uClinux-dist/lib/libcurl/compiled/lib/libcurl.a $(LDLIBS)

The linker error that I'm getting is:
/home/motoct/uClinux-dist/lib/libc/./libc.a(errno_loc.o)(.data+0x0):
multiple definition of `errno'
/home/motoct/uClinux-dist/lib/libc/crt0.o(.data+0x4): first defined here
collect2: ld returned 1 exit status
make[2]: *** [messenger] Error 1

I guess this means that I'm also bringing in all the dependencies of
libcurl and I'm trying to re-link to them as well. I don't really
understand why this error happens to be honest, so my question is how
do you link to a static library in uClinux?

Either my Makefile syntax is not correct, or I haven't compiled
libcurl properly as a static library. I noticed that other static
libraries (for example libnet) are compiled using the arm-elf-ar
utility. I read the man of the ar utility and I tried to apply that to
libcurl. Unfortunately I got these errors:
messenger.elf2flt(.text+0xd58): In function `get_login_server':
: undefined reference to `curl_slist_append'
messenger.elf2flt(.text+0xd74): In function `get_login_server':
: undefined reference to `curl_global_init'
messenger.elf2flt(.text+0xd78): In function `get_login_server':
: undefined reference to `curl_easy_init'
...

This should be a simple thing, yet I've been stuck here for a week.

Thanks in advance,
Tiberiu
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to