オブジェクト.hpp
#ifndef OBJECT_HPP
#define OBJECT_HPP
#include <SFML/Graphics.hpp>
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
オブジェクト.cpp
void Object::update() {
}
ここに私のメイクファイルがあります:
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
ビルド時に発生するエラーは次のとおりです(ビルド後、リンカーエラーです):
/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
何が起こっているのか分かりますか?前もって感謝します。