[英]g++ error no such file or directory
當我嘗試在unix終端中編譯.cpp
文件時,我一直收到此錯誤。
這是我的命令:
-bash-4.2$ g++ -o test.cpp test
輸出:
g++: error: test: No such file or directory
g++: fatal error: no input files
compilation terminated.
但是,當我輸入ls
:
test.cpp
我的g ++版本錯誤嗎?
您的命令行錯誤。 嘗試這個
g++ -o test test.cpp
語法為-o <output-file>
,但是您的輸入文件在此處列出,因此g ++一直在尋找test
作為輸入文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.