This is my try:
CMD file:
@SET PATH=%PATH%;D:\mingw\bin
type test10.cpp | g++ -xc++ -o test10.exe
code (irrelevant here): int main() {}
error I get:
g++: fatal error: no input files
compilation terminated.
I thought that the -x option is for signalizing stdin input, gcc itself said me that.
The -x
option specifies the input language, but it doesn't tell g++ to read from stdin. To do that, you can pass a single dash as a file name.
type test10.cpp | g++ -o test10.exe -x c++ -
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With