簡體   English   中英

g ++錯誤沒有這樣的文件或目錄

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM