Subject: bin/402: dynamic ld can't figure out what functions it needs
To: None <gnats-admin>
From: James Jegers <jimj@enigma.cs.uwm.edu>
List: netbsd-bugs
Date: 08/08/1994 12:05:10
>Number:         402
>Category:       bin
>Synopsis:       dynamic ld can't figure out what functions it needs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug  8 12:05:09 1994
>Originator:     James Jegers
>Organization:
"	"
>Release:        
>Environment:
	
System: NetBSD enigma.cs.uwm.edu 1.0 beta ENIGMA#1 i386


>Description:
	
      The linker doesn't figure out all of the libraries to link in
      when compiling in the dynamic form.  A static link, it will complain
      about unresolved functions.  (I have only seen this problem with
      the curses library).
>How-To-Repeat:
	

%m %/-> more i.c
#include <curses.h>

main()
{
   initscr();
}

%m %/-> cc i.c -lcurses
%m %/-> a.out
ld.so: Undefined symbol "_tgetent" called from a.out:/usr/lib/libcurses.so.2.0 at 0x1002226c

%m %/-> cc -static i.c -lcurses
setterm.o: Undefined symbol `_tgetent' referenced from text segment
setterm.o: Undefined symbol `_tgetnum' referenced from text segment
....
refresh.o: Undefined symbol `_tputs' referenced from text segment
refresh.o: More undefined symbol _tputs refs follow
cr_put.o: Undefined symbol `_tgoto' referenced from text segment

%m %/-> cc i.c -lcurses -ltermcap
%m %/-> a.out
%m %/-> cc -static i.c -lcurses -ltermcap
%m %/-> a.out
%m %/-> 

   Similar things happen when compiling with the c++ compiler, once the 
   curses.h header file is fixed for __BEGIN_DECLS, __END_DECLS.

>Fix:
	
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------