如何纠正用'&'命名c文件时Build failed的错误?
How can I rectify the error Build failed when naming c files with '&'?
当我尝试使用“&”命名 C 文件时出现错误(如 'Sum of Int&float')。但是当我删除'&'时错误被清除了。为什么使用“&”命名会产生 errors.I am using Eclipse IDE for c/c++ 2021-03.
make all
Building file: ../src/int&float.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/int&float.d" -MT"src/int&float.o" -o "src/int&float.o" "../src/int&float.c"
Finished building: ../src/int&float.c
Building target: Sum of int&float
Invoking: GCC C Linker
gcc -o "Sum of int&float" ./src/int&float.o
/bin/sh: 1: float.o: not found
make: *** [makefile:32: Sum of int&float] Error 127
gcc: error: ./src/int: No such file or directory
gcc: fatal error: no input files
compilation terminated.
"make all" terminated with exit code 2. Build might be incomplete.
18:02:24 Build Failed. 1 errors, 0 warnings. (took 685ms)```
&
字符是shell的特殊字符,用于将进程置于后台。
您可以将文件名放在引号中,但出于此类原因,最好避免在文件名中使用该字符。
当我尝试使用“&”命名 C 文件时出现错误(如 'Sum of Int&float')。但是当我删除'&'时错误被清除了。为什么使用“&”命名会产生 errors.I am using Eclipse IDE for c/c++ 2021-03.
make all
Building file: ../src/int&float.c
Invoking: GCC C Compiler
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/int&float.d" -MT"src/int&float.o" -o "src/int&float.o" "../src/int&float.c"
Finished building: ../src/int&float.c
Building target: Sum of int&float
Invoking: GCC C Linker
gcc -o "Sum of int&float" ./src/int&float.o
/bin/sh: 1: float.o: not found
make: *** [makefile:32: Sum of int&float] Error 127
gcc: error: ./src/int: No such file or directory
gcc: fatal error: no input files
compilation terminated.
"make all" terminated with exit code 2. Build might be incomplete.
18:02:24 Build Failed. 1 errors, 0 warnings. (took 685ms)```
&
字符是shell的特殊字符,用于将进程置于后台。
您可以将文件名放在引号中,但出于此类原因,最好避免在文件名中使用该字符。