ohai / ruby-sdl2

A Ruby wrapper for SDL 2.x
GNU Lesser General Public License v3.0
72 stars 16 forks source link

Will not compile mixer.c #6

Closed sunnystormy closed 7 years ago

sunnystormy commented 7 years ago

I get the following error when trying to compile:

`compiling mixer.c mixer.c: In function ‘Mixer_s_open’: mixer.c:171:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(Mix_OpenAudio((freq == Qnil) ? MIX_DEFAULT_FREQUENCY : NUM2INT(freq), ^~~~ mixer.c: In function ‘Channels_s_play’: mixer.c:318:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(ch); ^~~~ mixer.c: In function ‘Channels_s_fade_in’: mixer.c:357:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(ch); ^~~~ mixer.c: In function ‘MusicChannel_s_play’: mixer.c:700:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(Mix_PlayMusic(Get_Mix_Music(music), NUM2INT(loops))); ^~~~ mixer.c: In function ‘MusicChannel_s_fade_in’: mixer.c:727:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(Mix_FadeInMusicPos(Get_Mix_Music(music), NUM2INT(loops), ^~~~ mixer.c: In function ‘MusicChannel_s_set_position’: mixer.c:807:5: error: format not a string literal and no format arguments [-Werror=format-security] HANDLE_MIX_ERROR(Mix_SetMusicPosition(NUM2DBL(position))); ^~~~ mixer.c: In function ‘Chunk_s_load’: mixer.c:909:9: error: format not a string literal and no format arguments [-Werror=format-security] MIX_ERROR(); ^~~~~ mixer.c: In function ‘Music_s_load’: mixer.c:1025:5: error: format not a string literal and no format arguments [-Werror=format-security] if (!music) MIX_ERROR(); ^~ cc1: some warnings being treated as errors Makefile:253: recipe for target 'mixer.o' failed make: *** [mixer.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ruby-sdl2-0.3.0 for inspection. Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ruby-sdl2-0.3.0/gem_make.out `

ohai commented 7 years ago

I cannot reproduce this error on debian testing with SDL2.0.5 and ruby 2.4.0p0. What is your environment?

sunnystormy commented 7 years ago

A 'ruby --version' shows: "ruby 2.3.3p222"

I am on Debian Testing as well, and my SDL2 install is the one from the Debian repos.

ohai commented 7 years ago

Now I reproduce the problem, and fix it in 530fa1dfc30af2dd07112eb5942cb0cc2b2d8d59. Please try the latest version on github. If you are OK, I will release a new version.

sunnystormy commented 7 years ago

@ohai It works! Just installed it on my machine. Thank you very much for your help! :smile:

ohai commented 7 years ago

OK. This issue is closed. Thank you for your report.