This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++-v3 and pthread
- To: chris at ludwig-alpha dot unil dot ch (Christian Iseli)
- Subject: Re: libstdc++-v3 and pthread
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Thu, 30 Nov 2000 07:40:51 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
> I've noticed that the latest libstdc++-v3 requires linking with pthread (at
> least on Linux). However, the g++ driver doesn't link to pthread by default.
>
> What is the proper way ? Fix the g++ driver to add -lpthread ? Or require
> the users to add -lpthread ?
The g++ driver should add all required libraries. It won't do to ask the
user to add -lpthread as in
g++ o_file_1.o o_file_2.o -lpthread
because the searching order will be wrong; the user would have to write
g++ o_file_1.o o_file_2.o -lstdc++ -lpthread
at least, meaning that -lstdc++ is scanned twice.