-3

它一直在告诉我

gcc hello.cpp -o hello
gcc: error: hello.cpp: No such file or directory
gcc: fatal error: no input files
compilation terminated.

请任何人帮助

4

2 回答 2

1

源文件需要位于您调用 gcc 的同一路径中,或者您可以将完整路径放在那里

gcc /home/username/Desktop/hello.cpp

或者您可以执行 cd /home/username/Desktop 然后从该给定路径调用 gcc。

于 2014-07-29T14:59:07.427 回答
0

设置 .cpp 文件所在的当前目录

于 2014-07-29T14:59:20.827 回答