Hello
I'm having trouble setting up SFML on my laptop running Ubuntu 13.10 (32 bit). I've managed to set it up successfully already on my PC running Arch Linux (64 bit), but after carefully reproducing the steps I took it still doesn't work.
I downloaded the SFML sources, ran
cmake-gui and successfully configured the project to a second directory. Running make completes successfully, and all the files are successfully installed to
/usr/local after calling make install.
On both my machines, I've set the environment variables:
LD_LIBRARY_PATH=/usr/local/libC_INCLUDE_PATH=/usr/local/includeCPLUS_INCLUDE_PATH=/usr/local/includeJust for testing purposes, I'm trying to build the example from
http://www.sfml-dev.org/tutorials/2.1/start-linux.phpThe command I'm using to build is:
g++ -O3 -Wall -Wextra -pedantic -std=c++11 -lsfml-graphics -lsfml-window -lsfml-system main.cppEven when I try adding the
-L/usr/local flag, which shouldn't be necessary with my environment variables set, I still get SFML linker errors.
The following is the output I get, just for completeness' sake:
/tmp/cc9WdUuM.o: In function `main':
main.cpp:(.text.startup+0x5b): undefined reference to `sf::String::String(char const*, std::locale const&)'
main.cpp:(.text.startup+0x7f): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
main.cpp:(.text.startup+0xba): undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
main.cpp:(.text.startup+0xee): undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
main.cpp:(.text.startup+0xfa): undefined reference to `sf::Color::Green'
main.cpp:(.text.startup+0x102): undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
main.cpp:(.text.startup+0x10c): undefined reference to `sf::Window::isOpen() const'
main.cpp:(.text.startup+0x130): undefined reference to `sf::Window::pollEvent(sf::Event&)'
main.cpp:(.text.startup+0x15c): undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
main.cpp:(.text.startup+0x16f): undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
main.cpp:(.text.startup+0x186): undefined reference to `sf::RenderStates::Default'
main.cpp:(.text.startup+0x18e): undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
main.cpp:(.text.startup+0x196): undefined reference to `sf::Window::display()'
main.cpp:(.text.startup+0x1a4): undefined reference to `sf::Window::close()'
main.cpp:(.text.startup+0x1b8): undefined reference to `vtable for sf::CircleShape'
main.cpp:(.text.startup+0x1c0): undefined reference to `vtable for sf::CircleShape'
main.cpp:(.text.startup+0x1c5): undefined reference to `sf::Shape::~Shape()'
main.cpp:(.text.startup+0x1cd): undefined reference to `sf::RenderWindow::~RenderWindow()'
main.cpp:(.text.startup+0x207): undefined reference to `sf::RenderWindow::~RenderWindow()'
main.cpp:(.text.startup+0x220): undefined reference to `vtable for sf::CircleShape'
main.cpp:(.text.startup+0x228): undefined reference to `vtable for sf::CircleShape'
main.cpp:(.text.startup+0x22d): undefined reference to `sf::Shape::~Shape()'
collect2: error: ld returned 1 exit statusMaybe I'm just missing a crucial step, or I'm missing something that I'm unaware I should be doing to get it running in Ubuntu. Nevertheless, I would appreciate a fresh set of eyes looking at my situation, because I can't seem to get this working by myself. Thanks in advance