SOLVED: See third post
I'm on my second programming language, and I decided I wanted to make a game or music player. I chose SFML, merely because it was more feature-rich. I tried using "sudo apt-get install libsfml-dev", and it worked. I went to compile a program, and it gave me:
Code:
make test
g++ test.cpp -o test
/tmp/cc5DhUEp.o: In function `main':
test.cpp:(.text+0xf7): undefined reference to `sf::String::String(char const*, std::locale const&)'
test.cpp:(.text+0x115): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
test.cpp:(.text+0x148): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
test.cpp:(.text+0x182): undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
test.cpp:(.text+0x18e): undefined reference to `sf::Color::Green'
test.cpp:(.text+0x196): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
test.cpp:(.text+0x1b6): undefined reference to `sf::Window::close()'
test.cpp:(.text+0x1cf): undefined reference to `sf::Window::pollEvent(sf::Event&)'
test.cpp:(.text+0x1f7): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
test.cpp:(.text+0x214): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
test.cpp:(.text+0x22b): undefined reference to `sf::RenderStates::Default'
test.cpp:(.text+0x236): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
test.cpp:(.text+0x245): undefined reference to `sf::Window::display()'
test.cpp:(.text+0x254): undefined reference to `sf::Window::isOpen() const'
test.cpp:(.text+0x27f): undefined reference to `sf::RenderWindow::~RenderWindow()'
test.cpp:(.text+0x2a9): undefined reference to `sf::RenderWindow::~RenderWindow()'
test.cpp:(.text+0x2ee): undefined reference to `sf::RenderWindow::~RenderWindow()'
/tmp/cc5DhUEp.o: In function `sf::CircleShape::~CircleShape()':
test.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0x13): undefined reference to `vtable for sf::CircleShape'
test.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0x1f): undefined reference to `vtable for sf::CircleShape'
test.cpp:(.text._ZN2sf11CircleShapeD2Ev[_ZN2sf11CircleShapeD5Ev]+0x2b): undefined reference to `sf::Shape::~Shape()'
collect2: error: ld returned 1 exit status
I don't think it was installed to a non-standard directory, because I used apt-get. If it was, where was it installed to, and how can I point the compiler there?
I tried the instructions on this site: "http://en.sfml-dev.org/forums/index.php?topic=9808.0", but I still received the same errors. What, exactly, is wrong, and how can I fix it?
Bookmarks