怎样解决这个问题g++.exe: fatal error: no input files
时间: 2023-12-31 15:05:38 浏览: 1505
"g++.exe: fatal error: no input files" 这个错误通常是由于在执行 g++ 命令时,没有指定要编译的源文件而导致的。
解决方法:
1. 确认您的代码文件存在,并确定您的 g++ 命令正确指向了代码文件的路径。
2. 在 g++ 命令后加上要编译的源文件名,例如:
```
g++ your_file.cpp
```
或者
```
g++ -o your_program your_file.cpp
```
这将把您的源文件编译成一个可执行文件,您可以通过运行 ./your_program 来执行它。
3. 如果您的代码文件名不是 .cpp 结尾的,请将 g++ 命令中的 .cpp 替换为您的文件扩展名。
希望这能帮助到您。
相关问题
gcc.exe: error: 1.输出: No such file or directory gcc.exe: error: Hello: No such file or directory gcc.exe: error: World.c: No such file or directory gcc.exe: error: Hello: No such file or directory gcc.exe: error: World: No such file or directory gcc.exe: fatal error: no input files
这个错误提示表明gcc无法找到要编译的文件。请确认你的代码文件是否存在,并且路径是否正确。另外,也需要确认你是否正确地指定了要编译的文件名称。可以尝试使用绝对路径来避免路径错误的问题。例如:
```
gcc /path/to/HelloWorld.c -o HelloWorld
```
其中,`/path/to/`代表HelloWorld.c所在的目录,`HelloWorld`是编译后的可执行文件名称。
arm-none-eabi-gcc.exe:arm-none-eabi-gcc.exe: fatal error: fatal error: no input files
这个错误提示意味着没有给GCC编译器提供任何输入文件。请检查你的命令行,确保你已经指定了要编译的源代码文件。例如,如果你的源代码文件名为main.c,你可以使用以下命令来编译它:
```
arm-none-eabi-gcc -o main.elf main.c
```
其中,`-o main.elf`指定输出文件名为main.elf,而`main.c`则是要编译的源代码文件名。如果你的命令行中没有指定源代码文件名,则会出现上述错误提示。
阅读全文
相关推荐
















