title: Need help understanding how GCC compilation work on linux and macOS
body: <p>I recently obtained a macbook so I started learning how to develop project on macOS, to do so, I tried to compile a finished project I made on linux, the .o file got created easily but I had trouble with the executable.</p>
  
  <p>Here is the line : </p>
  
  <pre><code>gcc -Wall -g -O2 `sdl2-config --cflags` head.h -o game.out mainSDL.o container.o update.o user.o -O2 `sdl2-config --libs` -lSDL2_image 
  
  clang: error: cannot specify -o when generating multiple output files
  make: *** [game.out] Error 1
  </code></pre>
  
  <p>(I have sdl2 installed on this pc)</p>
  
  <p>This line was working perfectly under archlinux.</p>
  
  <p>This project compile easily with some basic command like :</p>
  
  <pre><code>gcc container.c mainSDL.c user.c update.c -lSDL2
  </code></pre>
  
  <p>But I would like to understand what's going on,</p>
  
  <p>Why this error with this line ?</p>
  
  <p>Thanks for your help</p>
  
  <p>Edit : Finally the problem came from this bad makefile which had some useless line and a header in it.</p>