This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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