#include <stdlib.h>
int main(int argc, char* argv[])
{
// printf("Hello World!\n");
return 0;
}
gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc -O0 -g -o helloworld -c helloworld.c
This is a fresh system built from scratch today. Ubuntu 18.04.
Produces a helloworld file but not executable if I make it so and try and run it i get
$ chmod +x helloworld
$ ./helloworld
bash: ./helloworld: cannot execute binary file: Exec format error
However seems to compile my large project without any problem.
Even though its a fresh system I reinstalled gcc but no difference.