这是我的尝试:
CMD文件:
@SET PATH=%PATH%;D:\mingw\bin
type test10.cpp | g++ -xc++ -o test10.exe
Run Code Online (Sandbox Code Playgroud)
代码(这里不相关): int main() {}
错误我得到:
g++: fatal error: no input files
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
我认为-x选项用于表示stdin输入,gcc本身就是这么说的.
Joh*_*ica 15
该-x
选项指定输入语言,但它不告诉g ++从stdin读取.为此,您可以将单个短划线作为文件名传递.
type test10.cpp | g++ -o test10.exe -x c++ -
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2914 次 |
最近记录: |