*BSD News Article 79810


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!asstdc.scgt.oz.au!nsw.news.telstra.net!act.news.telstra.net!psgrain!usenet.eel.ufl.edu!spool.mu.edu!newspump.sol.net!www.nntp.primenet.com!nntp.primenet.com!news1.best.com!nntp1.best.com!usenet
From: Brian Quirion <quirion@ix.netcom.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: shared objects HELP
Date: Wed, 02 Oct 1996 19:28:14 -0700
Organization: Internet Middleware
Lines: 44
Message-ID: <3253246E.491A@ix.netcom.com>
NNTP-Posting-Host: danzigf.vip.best.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (X11; U; SunOS 5.5 sun4m)

I am trying to create and use a shared library.


I create the library like so
ld -Bshareable userapi.o -o userapi.so

this give me the .so file

The program then does this


    if (dll_handle) dlclose(dll_handle);
    dll_handle = NULL;
    dll_handle = dlopen(user_api_lib, 1);


    API.errorFormat = (char* (*) (
			      char*          cached_version,
			      char*          visible_hostname,
	   		      char*          real_hostname,
			      int            ascii_port,
			      char*          error_msg_buf,
			      ErrorCode_e    error_code,
			      int            error_section,
			      char*          url,
			      char*          extra_text,
			      int*           ttl_ptr,
			      ErrorMsgType*  default_error_msg,
			      char*          redirection_url))
	    dlsym(dll_handle, "apiErrorFormat");

	this nastiness is just a big typecast so compiler wont complain.

problem is dlopen works fine.  dll_handle is not null but dlsym always
returns null.  Please help!!!



-- 
Brian Quirion

Internet Middleware

(408) 437-7785 ext. 338