简体   繁体   English

GCC编译器优化,无法与架构x86_64的主可执行文件“ _”链接

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

相关问题 linux x86_64 vm gcc可执行输出的体系结构中的错误,exec文件格式错误 - linux x86_64 vm gcc error in architecture of executable output, exec file format error 架构 x86_64 的未定义符号:“_main”,引用自:主要可执行文件的隐式入口/启动 - Undefined symbols for architecture x86_64: "_main", referenced from: implicit entry/start for main executable OS X上的Gcc:体系结构x86_64的未定义符号 - Gcc on OS X: Undefined symbols for architecture x86_64 ld: 无法打开 output 文件进行写入: bin/s, errno=2 for architecture x86_64 - ld: can't open output file for writing: bin/s, errno=2 for architecture x86_64 架构x86_64 MAC GCC的未定义符号 - Undefined symbols for architecture x86_64 MAC GCC raylib 编译器错误:“架构 x86_64 的未定义符号” - raylib compiler error: "Undefined symbols for architecture x86_64" 编译 .C 文件:体系结构 x86_64 的未定义符号 - Compiling a .C file: Undefined symbols for architecture x86_64 C无法编译 - 找不到架构x86_64的符号 - C can't compile - symbol(s) not found for architecture x86_64 MPICH:MPICC ld:找不到文件:/usr/local/lib/gcc/4.9/libgfortran.3.dylib用于架构x86_64 - MPICH: MPICC ld: file not found: /usr/local/lib/gcc/4.9/libgfortran.3.dylib for architecture x86_64 Windows x86_64上的免费编译器 - Free Compiler for Windows on x86_64
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM