mickelson / sfml-pi

SFML on Linux without X11 using DRM/KMS (or dispmanx on RPi0-3)
Other
62 stars 26 forks source link

trying to compile sample undefined OES_framebuffer_object #26

Open natxopedreira opened 1 year ago

natxopedreira commented 1 year ago

Hello

I'm trying to make this work with yocto on intel platform, i compile sfml pi with no problem

-DSFML_DRM=1 -DSFML_OPENGL_ES=1

Later i create a simple sample

#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;
}

That i compile main.cpp -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system -lsfml-window -lGLESv1_CM -lGLESv2

And i get sereval undefinded methods..

../lib/libsfml-graphics.so: undefined reference to `glFramebufferTexture2DOES'
../lib/libsfml-graphics.so: undefined reference to `glGenRenderbuffersOES'
../lib/libsfml-graphics.so: undefined reference to `glGenerateMipmapOES'
../lib/libsfml-graphics.so: undefined reference to `glCheckFramebufferStatusOES'
../lib/libsfml-graphics.so: undefined reference to `glBlendEquationSeparateOES'
../lib/libsfml-graphics.so: undefined reference to `glBindFramebufferOES'
../lib/libsfml-graphics.so: undefined reference to `glRenderbufferStorageOES'
../lib/libsfml-graphics.so: undefined reference to `glDeleteRenderbuffersOES'
../lib/libsfml-graphics.so: undefined reference to `glFramebufferRenderbufferOES'
../lib/libsfml-graphics.so: undefined reference to `glBindRenderbufferOES'
../lib/libsfml-graphics.so: undefined reference to `glDeleteFramebuffersOES'
../lib/libsfml-graphics.so: undefined reference to `glGenFramebuffersOES'
../lib/libsfml-graphics.so: undefined reference to `glBlendFuncSeparateOES'

Any clue? Thanks

Cebion commented 1 year ago

I have a similar problem while trying to compile https://github.com/Cirrus-Minor/witchblast


[  1%] Linking CXX executable Witch_Blast
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glFramebufferTexture2DOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_device_get_fd'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glGenRenderbuffersOES'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glGenerateMipmapOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_create_device'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_set_user_data'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_create'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_height'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glCheckFramebufferStatusOES'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glBlendEquationSeparateOES'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glBindFramebufferOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_handle'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_stride'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glRenderbufferStorageOES'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glDeleteRenderbuffersOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_release_buffer'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_offset'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_modifier'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_plane_count'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_device'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_format'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glFramebufferRenderbufferOES'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glBindRenderbufferOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_width'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glDeleteFramebuffersOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_device_destroy'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_stride_for_plane'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_bo_get_user_data'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glGenFramebuffersOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_lock_front_buffer'
/usr/bin/ld: /usr/local/lib/libsfml-graphics.so: undefined reference to `glBlendFuncSeparateOES'
/usr/bin/ld: /usr/local/lib/libsfml-window.so: undefined reference to `gbm_surface_destroy'
collect2: error: ld returned 1 exit status```

Found a solution?
colesnicov commented 7 months ago

Hello. Works?