This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gfortran read stdin
- From: John Love-Jensen <eljay at adobe dot com>
- To: coml <coml at san dot rr dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 29 Oct 2008 06:18:39 -0500
- Subject: Re: gfortran read stdin
Hi Hugh,
I'm not sure about gfortran, but here is how I do it for C++:
Mystery2Cpp blah.mystery | g++ -c -x c++ - -o blah.o
-x c++
Tells g++ that the source code is C++. Since g++ will accept a variety of
source code, and (otherwise) use the extension to select the proper
compiler.
-
The dash is used to mean "use input from stdin". Since stdin is bereft of
any sort of extension, the -x switch is necessary.
-c
Compile only, source to object. You probably know this one already.
-o blah.o
Output to the given file, blah.o. You probably know this one already, too.
HTH,
--Eljay