libstdc++-v3 and pthread
Joe Buck
jbuck@racerx.synopsys.com
Thu Nov 30 07:44:00 GMT 2000
> 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.
More information about the Gcc
mailing list