From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,670da90686135444 X-Google-Attributes: gidfee84,public From: swettk@my-deja.com Subject: Re: Linking Statically & Dynamically with GCC Date: 2000/01/19 Message-ID: <865b59$pch$1@nnrp1.deja.com>#1/1 X-Deja-AN: 574803129 References: <85d6ah$esg$1@nnrp1.deja.com> <85opbb$i6n$1@news.ndsu.nodak.edu> X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 128.117.23.24 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Jan 19 21:43:10 2000 GMT X-MyDeja-Info: XMYDJUIDswettk Newsgroups: comp.unix.osf.osf1 X-Http-User-Agent: Mozilla/4.61 [en] (X11; I; SunOS 5.6 sun4u) Thanks to both for your advice. I used the -Wl,-no_so and -Wl,-no_archive and it worked like a charm. Karin In article <85opbb$i6n$1@news.ndsu.nodak.edu>, mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) wrote: > In article <85d6ah$esg$1@nnrp1.deja.com>, wrote: > > I'm installing software on osf1 v4.0 that requires some libraries to be > > linked statically and others dynamically. On other platforms (SunOS, > > LINUX, and IRIX), I have successfully used the -Wl,-Bstatic and > > -Wl,Bdynamic flags, but these flags are unrecognized on this platform. > > -Wl says "pass the following option to the linker". Tru64's linker doesn't > grok `-Bstatic' or `-Bdynamic'. It does grok things like `-non_shared', > `-no_so', et. al. See the `ld' man page. You probably need multiple > occurrences of `-no_so' and `-no_archive' to arrange to have just certain > library linked in statically. Tru64's linker doesn't have (unfortunately) > a `-prefer_static' or `-archive_shared' option, a la HP-UX's linker. You > may also need to pay special attention to the `-oldstyle_liblookup' flag. > > gcc and g++ have their own options to indicate you want to do static or shared > linking. See the gcc info node for "Link Options". Passing (e.g.) -static > to the compiler causes it to pass the appropriate flags to the linker for > the platform it's on. > > If you're using gcc 2.95.1, I ran into what I think is a bug with how gcc > passes options to programs it invokes on your behalf (such as ld). I don't > know if that's been fixed in 2.95.2, but it caused some arguments to not > be passed on correctly. > > Tim > > > Thanks in advance, > > Karin > -- > Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu > Information Technology Services (701) 231-1076 (Voice) > Room 242-J1, IACC Building (701) 231-8541 (Fax) > North Dakota State University, Fargo, ND 58105-5164 > Sent via Deja.com http://www.deja.com/ Before you buy.