Weird SFML errors

closed account (Dy7SLyTq)
I decided to try my hand at SFML while im waiting for lazy foo to finish his tutorials, and im getting some weird errors. im running natty for my os, and am doing this via the terminal. Here is the code i used:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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;
}


side note: This is my directory tree:
Desktop -> SFML -> SFML-2.1 -> include, lib, share
|
Mirrors of Elixia
|
main.cpp

and am compiling with this:
1
2
g++ -c main.cpp -I../SFML-2.1/include (which works fine)
g++ main.o -o sfml-app -L../SFML-2.1/lib -lsfml-graphics -lsfml-window -lsfml-system (which throws a bunch of errors)


these are the errors:
/usr/bin/ld: skipping incompatible ../SFML-2.1/lib/libsfml-graphics.so when searching for -lsfml-graphics
/usr/bin/ld: cannot find -lsfml-graphics
/usr/bin/ld: skipping incompatible ../SFML-2.1/lib/libsfml-window.so when searching for -lsfml-window
/usr/bin/ld: cannot find -lsfml-window
/usr/bin/ld: skipping incompatible ../SFML-2.1/lib/libsfml-system.so when searching for -lsfml-system
/usr/bin/ld: cannot find -lsfml-system
collect2: ld returned 1 exit status

how do i fix this?
Did you build SFML or use a binary package?
closed account (Dy7SLyTq)
binary. 64 bit
Try building it.
closed account (Dy7SLyTq)
sorry my mistake... i guess i grabbed the wrong ubuntu disk when i wanted to install, and accidently installed 32 bit and i was using 64 bit so's
closed account (Dy7SLyTq)
one last question. now im getting these errors:
/usr/bin/ld: warning: libGLEW.so.1.7, needed by ../SFML-2.1/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libjpeg.so.8, needed by ../SFML-2.1/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewDeleteFramebuffersEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniformMatrix4fvARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_blend_func_separate'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shading_language_100'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_stdio_dest@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGetHandleARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewBindFramebufferEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGenFramebuffersEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewCheckFramebufferStatusEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewAttachObjectARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_CreateCompress@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewRenderbufferStorageEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_fragment_shader'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniform1fARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferTexture2DEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewLinkProgramARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_set_defaults@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGetObjectParameterivARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_destroy_compress@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_shader_objects'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniform2fARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `glewInit'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_EXT_framebuffer_object'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_set_quality@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewDeleteRenderbuffersEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_texture_non_power_of_two'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewDeleteObjectARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `glewGetErrorString'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewCreateProgramObjectARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_write_scanlines@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUseProgramObjectARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewCreateShaderObjectARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniform3fARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGetInfoLogARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniform1iARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewUniform4fARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGenRenderbuffersEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewBlendFuncSeparateEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewGetUniformLocationARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewActiveTextureARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_start_compress@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_std_error@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewCompileShaderARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__GLEW_ARB_vertex_shader'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `jpeg_finish_compress@LIBJPEG_8.0'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewShaderSourceARB'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewBindRenderbufferEXT'
../SFML-2.1/lib/libsfml-graphics.so: undefined reference to `__glewFramebufferRenderbufferEXT'
collect2: ld returned 1 exit status


and it looks like its all because of libjpeg and libglew. i know glew is from opengl. is jpeg also? if i install opengl will these errors go away?
They are two separate packages. I dont remember the exact names, apt-cache search glew and libjpeg.
closed account (Dy7SLyTq)
i ran apt-cache search glew and then apt-cache search jpeg and got these results:
libglewmx1.5 - The OpenGL Extension Wrangler - runtime environment
libglew1.5 - The OpenGL Extension Wrangler - runtime environment

and this:
libexif12 - library to parse EXIF files
libjpeg62 - The Independent JPEG Group's JPEG runtime library (version 6.2)
libwmf0.2-7 - Windows metafile conversion library
exiv2 - EXIF/IPTC metadata manipulation tool
libjasper1 - The JasPer JPEG-2000 runtime library
poppler-utils - PDF utilities (based on Poppler)
libwmf0.2-7-gtk - Windows metafile conversion library
python-imaging - Python Imaging Library
libexiv2-10 - EXIF/IPTC metadata manipulation library


i tried sudo apt-get installing both of the glew ones and the libjpeg62, but it said they were all already up to date
Looks like it wants glew1.7 and libjpeg8, you need to upgrade your OS or find those packages for natty.
closed account (Dy7SLyTq)
alright thanks
Topic archived. No new replies allowed.