SDL2 and Framebuffer

Hi, I want using SDL 2.0.12 with framebuffer and for this download the last version and configure with the --enable-video-directfb, but when execute make I have this error:

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_events.c: In function ‘ProcessInputEvent’:
/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_events.c:312:9: warning: variable ‘kbd_idx’ set but not used [-Wunused-but-set-variable]

  • int kbd_idx;*
    
  •     ^~~~~~~*
    
  • CC build/SDL_DirectFB_modes.lo*
  • CC build/SDL_DirectFB_mouse.lo*
  • CC build/SDL_DirectFB_opengl.lo*
  • CC build/SDL_DirectFB_render.lo*
    /iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c: In function ‘SetBlendMode’:
    /iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:202:9: error: case label not within a switch statement
  •     case SDL_BLENDMODE_MUL:*
    
  •     ^~~~*
    

In file included from /iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_window.h:25:0,

  •             from /iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:24:*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:205:67: error: ‘DSBF_DSTCOLOR’ undeclared (first use in this function); did you mean ‘DSBF_DESTCOLOR’?

  •         SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));*
    
  •                                                               ^*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_video.h:99:49: note: in definition of macro ‘SDL_DFB_CHECK’

  • #define SDL_DFB_CHECK(x…) do { sdl_dfb_check( x, FILE, LINE); } while (0)*
  •                                             ^*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:205:67: note: each undeclared identifier is reported only once for each function it appears in

  •         SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));*
    
  •                                                               ^*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_video.h:99:49: note: in definition of macro ‘SDL_DFB_CHECK’

  • #define SDL_DFB_CHECK(x…) do { sdl_dfb_check( x, FILE, LINE); } while (0)*
  •                                             ^*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:208:13: error: break statement not within loop or switch

  •         break;*
    
  •         ^~~~~*
    

/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c: At top level:
/iSys/SDL2/SDL2-2.0.12/src/video/directfb/SDL_DirectFB_render.c:212:1: error: expected identifier or ‘(’ before ‘}’ token

  • }*
  • ^*
    Makefile:674: recipe for target ‘build/SDL_DirectFB_render.lo’ failed
    make: *** [build/SDL_DirectFB_render.lo] Error 1

Can you help me please!

Hello CFernandez, welcome to SDL Forums.

Your post is barely readable. Can you please edit your post and use the </> to mark the error as code, in this way indentation will be preserved and character will not be considered special Markdown symbols.

Anyway I have compiled here both Github head (https://github.com/SDL-mirror/SDL) and SDL2-2.0.12 (from https://www.libsdl.org/download-2.0.php ), and I don’t get any of these errors just one warning:

SDL2-2.0.12/src/test/SDL_test_memory.c: In function 'SDL_TrackAllocation':
src/SDL2-2.0.12/src/test/SDL_test_memory.c:112:103: warning: '+0x' directive output may be truncated writing 3 bytes into a region of size between 1 and 256 [-Wformat-truncation=]
  112 |                 snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset);
      |                                                                                                       ^~~
src/SDL2-2.0.12/src/test/SDL_test_memory.c:112:17: note: 'snprintf' output between 5 and 275 bytes into a destination of size 256
  112 |                 snprintf(entry->stack_names[stack_index], sizeof(entry->stack_names[stack_index]), "%s+0x%llx", sym, (unsigned long long)offset);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC     build/SDL_test_random.lo
  LTLINK build/libSDL2_test.la
ar: `u' modifier ignored since `D' is the default (see `U')

Which compiler are you using, which plataform and architecture?

Hi,
had the same problem today, looking at the source file there was indeed an error that was fixed by this commit after the release:
http://hg.libsdl.org/SDL/diff/769f80095217/src/video/directfb/SDL_DirectFB_render.c

Regards,
Roland

Yes. That is already fixed, that was the reason I asked about where the source came from. Anyway, he also need to better format his post.