Antonio Marfil
Antonio Marfil

Reputation: 31

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)

I need help please to make an optimization to my .cpp

Upvotes: 0

Views: 2862

Answers (1)

EdmCoff
EdmCoff

Reputation: 3586

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"

Upvotes: 4

Related Questions