1
General / Re: Can't get SFML working :(
« on: May 05, 2013, 06:16:27 pm »
2.0
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
./omg: error while loading shared libraries: libGLEW.so.1.5: cannot open shared object file: No such file or directory
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
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
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
g++ -Wall -o "omg" "omg.cpp" -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system (in directory: /home/ares/Desktop)
omg.cpp: In function ‘int main()’:
omg.cpp:6:5: error: ‘CircleShape’ is not a member of ‘sf’
omg.cpp:6:21: error: expected ‘;’ before ‘shape’
omg.cpp:7:5: error: ‘shape’ was not declared in this scope
omg.cpp:9:19: error: ‘class sf::RenderWindow’ has no member named ‘isOpen’
omg.cpp:12:23: error: ‘class sf::RenderWindow’ has no member named ‘pollEvent’
omg.cpp:14:23: error: ‘class sf::Event’ has no member named ‘type’
omg.cpp:15:24: error: ‘class sf::RenderWindow’ has no member named ‘close’
omg.cpp:18:16: error: ‘class sf::RenderWindow’ has no member named ‘clear’
omg.cpp:19:16: error: ‘class sf::RenderWindow’ has no member named ‘draw’
omg.cpp:20:16: error: ‘class sf::RenderWindow’ has no member named ‘display’
Compilation failed.
ldd "$(which glxgears)"
linux-vdso.so.1 => (0x00007fff01dff000)
libGL.so.1 => /usr/lib/fglrx/libGL.so.1 (0x00007fbdea1bf000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbde9ec3000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fbde9b88000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbde97c9000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbde95ac000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fbde9399000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fbde917b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbde8f77000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbdea3eb000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fbde8d72000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fbde8b6c000)