title: bash: ./remoteServer .o: cannot execute binary file: Exec format error
body: <p>I am trying to run the c program remoteServer.c. I compiled it using a Makefile. When i try to run it with ./remoteServer.o I get the following error. I read that it could be cause of different architecture but I saw that both were x86-64. I am running ubuntu 18.04.03 on a VM. The code for the make file is after the commands. Also i used chmod 777 on both the .c and .o files.</p>
  
  <pre><code>isidoros@isidoros-VirtualBox:~/choice$ ./remoteServer.o
  
  bash: ./remoteServer.o: cannot execute binary file: Exec format error
  
  isidoros@isidoros-VirtualBox:~/choice$ file remoteServer.c
  
  remoteServer.c: C source, ASCII text
  
  isidoros@isidoros-VirtualBox:~/choice$ file remoteServer.o
  
  remoteServer.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped
  
  isidoros@isidoros-VirtualBox:~/choice$ uname -m
  
  x86_64
  </code></pre>
  
  <p>Makefile:</p>
  
  <pre><code>OBJS    = remoteServer.o
  
  SOURCE  = remoteServer.c
  
  HEADER  = 
  
  OUT = make
  
  CC   = gcc
  
  FLAGS    = -g -c -Wall
  
  LFLAGS   = 
  
  all: $(OBJS)
      $(CC) -g $(OBJS) -o $(OUT) $(LFLAGS)
  
  remoteServer.o: remoteServer.c
      $(CC) $(FLAGS) remoteServer.c 
  
  clean:
      rm -f $(OBJS) $(OUT)
  </code></pre>