library order

David Wojtowicz davidw at uiuc.edu
Thu May 18 12:56:05 PDT 2006


Sorry to flood you with bug reports. I dug this and the other two up a few
days ago and am just getting around to writing about them..

 

It looks like libdap was split into  core, server and client components.
The order they are listed in the Makefile and libdap-config matter if you
are linking statically at least with gcc on linux.   If you put them in the
wrong order, you get undefined symbols. (works OK linking dynamically)   

 

In  libdap/Makefile.am it should be:    lib_LTLIBRARIES = libdapclient.la
libdapserver.la libdap.la 

  (move libdap.la to the end of the list)

 

In libdap/dap-config.in:  the targets -server-libs and -client-libs  should
have -ldap moved after -ldapclient and -ldapserver respectively.

 

 

Basically, libraries with references to objects need to come before the
libraries that define the objects so that an undefined reference is created,
which is then matched against the definition.    (gcc ld has a way of
searching the libraries multiple times to resolve all references, but it is
not recommended)

 

-----
David Wojtowicz, Sr. Research Programmer, Sysadmin
Dept of Atmospheric Sciences / Computer Services
University of Illinois at Urbana-Champaign
davidw at uiuc.edu  (217) 333-8390

 



More information about the Opendap-tech mailing list