This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++-v3 and pthread


> 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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]