[英]GCC Compiler Optimizations, can't link with a main executable file '_' for architecture x86_64
*Antonio10ms$ gcc pi.c -o1 pi
ld: can't link with a main executable file 'pi' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我需要帮助,请对我的.cpp进行优化
I think you are confusing the optimization argument with the output/target argument. 我认为您正在将优化参数与输出/目标参数混淆。
I think what you want is 我想你想要的是
gcc pi.c -o1 -o pi
where "-o1" means "optimization level 1" and "-o pi" means "output to an executable named pi" 其中“ -o1”表示“优化级别1”,“-o pi”表示“输出到名为pi的可执行文件”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.