Skip to content
Advertisement

Read binary file,cannot execute binary file: Exec format error

My code

JavaScript

When I compile with gcc gcc -c n1.c -o n1

and try to run it I got

JavaScript

File m_6 and n1.c were executed on the same machine.

JavaScript

How to solve this?

Advertisement

Answer

gcc -c compiles source files without linking.

Cancel -c from from command.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement