This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: Share object (libstdc++) - Software release question.
- To: "Guangsheng Liu" <liugs at hotmail dot com>
- Subject: Re: Share object (libstdc++) - Software release question.
- From: Joerg Faschingbauer <jfasch at hyperwave dot com>
- Date: Wed, 23 Feb 2000 09:47:03 +0100
- Cc: libstdc++ at sourceware dot cygnus dot com
- References: <20000222195546.70504.qmail@hotmail.com>
>>>>> "Guangsheng" == Guangsheng Liu <liugs@hotmail.com> writes:
Guangsheng> Could you do me a favor and answer me one more question? If -lstdc++ is
Guangsheng> specified, it will look for libstdc++.so first, then libstdc++.a if
Guangsheng> libstdc++.so doesn't exist.
Guangsheng> Now, I have both of them, what can I do to make link with libstdc++.a
Guangsheng> instead of libstdc++.so? I check all the documentation, can't find it.
Guangsheng> I appreciate your help.
(This is slightly off-topic here in this list; it rather belongs in
one of the gcc newsgroups, preferably gnu.g++.help.)
You could use -static generally, but this would lead to libc.a being
linked as well which is not desirable the way it is with
libstdc++. Several ways around it.
1. Use -v to determine what libs g++ takes under the hood. Then, use
-nodefaultlibs to switch them off and specifiy them yourself,
switching to -static before stdc++, and back to -dynamic afterwards.
2. Remove libstdc++.so. Don't know if that is an option; depends on
whether you are running programs linked against it.
3. (This is what I prefer.) Build gcc yourself, configuring a
different prefix to not disturb you default installation, and *not*
configuring --enable-shared (I still don't know why all
distributions come with a gcc configured that way). When compiling
and linking, be sure to call your own gcc, like
/my/own/prefix/bin/g++ -et cetera
Have fun,
Joerg