title: g++ file format not recognized; treating Object.o as linker script
body: <p><strong>Object.hpp</strong></p>
  
  <pre><code>#ifndef OBJECT_HPP
  #define OBJECT_HPP
  
  #include &lt;SFML/Graphics.hpp&gt;
  
  using namespace std;
  
  class Object {
    private:
      sf::Image image;
  
    public:
      float x;
      float y;
      int width;
      int height;
      sf::Sprite sprite;
  
      virtual void update();
  };
  
  #endif
  </code></pre>
  
  <p><strong>Object.cpp</strong></p>
  
  <pre><code>void Object::update() {
  
  }
  </code></pre>
  
  <p>Here's my Makefile:</p>
  
  <pre><code>LIBS=-lsfml-graphics -lsfml-window -lsfml-system
  
  all:
      @echo "** Building mahgame"
  
  State.o : State.cpp
      g++ -c State.cpp
  
  PlayState.o : PlayState.cpp
      g++ -c PlayState.cpp
  
  Game.o : Game.cpp
      g++ -c Game.cpp
  
  Object.o : Object.cpp
      g++ -c Object.cpp
  
  Player.o : Player.cpp
      g++ -c Player.cpp
  
  mahgame : Game.o State.o PlayState.o Object.o Player.o
      g++ -o mahgame Game.o State.o PlayState.o Object.o Player.o $(LIBS)
  
      #g++ -c "State.cpp" -o State.o
      #g++ -c "PlayState.cpp" -o PlayState.o
      #g++ -c "Game.cpp" -o Game.o
      #g++ -c "Object.hpp" -o Object.o
      #g++ -c "Player.hpp" -o Player.o
      #g++ -o mahgame Game.o State.o PlayState.o Object.o Player.o $(LIBS)
  
  clean:
      @echo "** Removing object files and executable..."
      rm -f mahgame
  
  install:
      @echo '** Installing...'
      cp mahgame /usr/bin
  
  uninstall:
      @echo '** Uninstalling...'
      rm mahgame
  </code></pre>
  
  <p>Here's the error I get when building (after building, it's a linker error):</p>
  
  <pre><code>/usr/bin/ld:Object.o: file format not recognized; treating as linker script
  /usr/bin/ld:Object.o:1: syntax error
  collect2: error: ld returned 1 exit status
  make: *** [all] Error 1
  </code></pre>
  
  <p>Any idea of what's going on? Thanks in advance.</p>