From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,c7260552d99c2912 X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: CC flags needed for using dlopen()? Date: 1999/06/15 Message-ID: <376655AB.69E773A0@allaire.com>#1/1 X-Deja-AN: 489846079 Content-Transfer-Encoding: 7bit References: <375EFB49.FCAB2B07@colorado.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 929453594 207.86.119.34 (Tue, 15 Jun 1999 09:33:14 EDT) Organization: Allaire Corporation MIME-Version: 1.0 NNTP-Posting-Date: Tue, 15 Jun 1999 09:33:14 EDT Newsgroups: comp.unix.osf.osf1 Rob Derstadt wrote: > Hello, > > I'd like to load a library at runtime using dlopen(...) and dlsym(...) > on an alpha running OSF1. I'm using cc and am not sure what > compiler/linker flags I need to use, does anyone know? Also, is there a > way to tell if the library I'd like to open is indeed loadable at > runtime? It's a 3rd part lib that I don't have source access to. Thanks > in advance. >From a compilation standpoint, the only requirement that I know of is that the program that wants to use dlopen() must be linked shared itself, that is, with -call_shared not -static. Because shared linking is the default, you don't need to do anything. As for the second part of your question, there's no real way to tell if you can load a library successfully without trying. Check the return status of your calls and be sure to code a nice failure path ;^) Seriously, a quick little program will tell you whether the library you have in mind will cooperate. __________________________________________________ Jeff Denham (jdenham@allaire.com) Allaire Corp: Resource-management software for building and managing fast, reliable web sites See us at http://www.allaire.com and http://www.brighttiger.com 125 Nagog Park Acton, MA 01720 Phone: (978) 263-5455 x177 Fax: (978) 263-5547