Andrew Otwell wrote:
 
> same problem. I'm trying though....
> 
> bash-2.03$ gcc -static -nostdlib -L/usr/lib \
> > -lalias -lalias_p -lc -lc_p -lc_pic -lcalendar -lcalendar_p -lcom_err -lcom_err_p \
> > -lcompat -lcompat_p -lcrypt -lcrypt_p -lcurses -lcurses_p \
> > -ldialog -ldialog_p -ldisk -ledit -ledit_p -lf2c -lf2c_p -lfl -lfl_p -lftpio \
> > -lftpio_p -lg++ -lg++_p -lgcc -lgcc_p -lgcc_pic -lgmp -lgmp_p \
> > -lgnuregex -lgnuregex_p -lipx -lipx_p -lkeycap -lkeycap_p -lkvm \
> > -lkvm_p -ll -ll_p -lln -lln_p -lm -lm_p -lmd -lmd_p -lmp -lmp_p -lmytinfo \
> > -lmytinfo_p -lncurses -lncurses_p -lobjc -lobjc_p -lopie -lopie_p \
> > -lpcap -lpcap_p -lreadline -lreadline_p -lrpcsvc -lrpcsvc_p -lscrypt \
> > -lscrypt_p -lscsi -lscsi_p -lskey -lskey_p -lss -lss_p -lstdc++ -lstdc++_p 
> > -ltelnet -ltelnet_p -ltermcap -ltermcap_p -ltermlib -ltermlib_p \
> > -lutil -lutil_p -lvgl -lvgl_p -lxpg4 -lxpg4_p -ly -ly_p -lz -lz_p \
> > test2.c
> >/var/tmp/ccaCTG6m.o: Undefined symbol `___main' referenced from text segment
> >/var/tmp/ccaCTG6m.o: Undefined symbol `_printf' referenced from text segment
> >/var/tmp/ccaCTG6m.o: Undefined symbol `_printf' referenced from text segment
> >collect2: ld returned 1 exit status
> bash-2.03$ 

>From the look of it, either your toolchain is mis-configured or
you're generating the wrong object format.

You should be seeing something like this (note lack of underscore):

    /tmp/ccmb1952.o: In function `main':
    /tmp/ccmb1952.o(.text+0xf): undefined reference to `printf'

I think you mentioned somewhere you're generating ELF (not a.out);
if so, your compiler is not doing the right thing for external
symbols.  What appeared in FreeBSD a.out libraries as "_printf" is
plain "printf" in ELF.  There is no "_printf" symbol in the standard
FreeBSD libc, nowadays.

--
Robert Nordier

[EMAIL PROTECTED]
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to