0 Members and 1 Guest are viewing this topic.
g++ -Wall -o "omg" "omg.cpp" -Isfml/include -Lsfml/lib (in directory: /home/ares/Desktop)/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::String::String(char const*, std::locale const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Texture::Texture()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Sprite::Sprite(sf::Texture const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Font::Font()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Font::loadFromFile(std::string const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::String::String(char const*, std::locale const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Text::Text(sf::String const&, sf::Font const&, unsigned int)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Music::Music()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Music::openFromFile(std::string const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::SoundStream::play()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Window::close()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Window::pollEvent(sf::Event&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderTarget::clear(sf::Color const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderStates::Default'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderStates::Default'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Window::display()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Window::isOpen() const'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Music::~Music()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Font::~Font()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Texture::~Texture()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderWindow::~RenderWindow()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderWindow::~RenderWindow()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Music::~Music()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Font::~Font()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::Texture::~Texture()'/tmp/ccQqHwMd.o:omg.cpp:function main: error: undefined reference to 'sf::RenderWindow::~RenderWindow()'/tmp/ccQqHwMd.o:omg.cpp:function sf::Sprite::~Sprite(): error: undefined reference to 'vtable for sf::Sprite'/tmp/ccQqHwMd.o:omg.cpp:function sf::Sprite::~Sprite(): error: undefined reference to 'vtable for sf::Sprite'/tmp/ccQqHwMd.o:omg.cpp:function sf::Sprite::~Sprite(): error: undefined reference to 'sf::Transformable::~Transformable()'/tmp/ccQqHwMd.o:omg.cpp:function sf::VertexArray::~VertexArray(): error: undefined reference to 'vtable for sf::VertexArray'/tmp/ccQqHwMd.o:omg.cpp:function sf::Text::~Text(): error: undefined reference to 'vtable for sf::Text'/tmp/ccQqHwMd.o:omg.cpp:function sf::Text::~Text(): error: undefined reference to 'vtable for sf::Text'/tmp/ccQqHwMd.o:omg.cpp:function sf::Text::~Text(): error: undefined reference to 'sf::Transformable::~Transformable()'/tmp/ccQqHwMd.o:omg.cpp:function sf::Text::~Text(): error: undefined reference to 'sf::Transformable::~Transformable()'Compilation failed.collect2: error: ld returned 1 exit status
To link a SFML library, you must add "-lsfml-xxx" to your command line, for example "-lsfml-graphics" for the graphics module
I just dropped sfml files to usr/local
g++ -Wall -o "omg" "omg.cpp" -Isfml/include -Lsfml/lib
g++ -Wall -o "omg" "omg.cpp" -L /usr/local/lib -lsfml-graphics -lsfml-window -lsfml-system (in directory: /home/ares/Desktop)Compilation finished successfully.
./omg: error while loading shared libraries: libsfml-graphics.so.2: cannot open shared object file: No such file or directory------------------(program exited with code: 127)Press return to continue
./omg: error while loading shared libraries: libGLEW.so.1.5: cannot open shared object file: No such file or directory