This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Basic Question on Building Multi-Threaded 'C' Apps with gcc
- From: Andrew Haley <aph at redhat dot com>
- To: Frank Tufano <frank at art-llc dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 3 Dec 2007 14:34:33 +0000
- Subject: Re: Basic Question on Building Multi-Threaded 'C' Apps with gcc
- References: <474EFB70.2050403@art-llc.com>
Frank Tufano writes:
> I am developing a multi-threaded application (written in 'C') on
> Linux on the AMD x86-64 platform. I would like to know what
> compile and link options I should be specifying to ensure that the
> application builds properly. (We are using the posix thread
> model). The only thread related option info I can find in the AMD
> x86-64 Options section of the online manual is the -mthreads
> option, which is for "thread-safe exception handling on `Mingw32'",
> which is not applicable. Below is my gcc version info and some
> system info.
The only specific option you will need is `-pthread'. This should do
everything that's needed to compile and link correctly in a
multi-threaded environment.
Andrew.
--
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903