warhammerkid / ruby-audio

ruby-audio wraps around libsndfile to provide simplified sound reading and writing support to ruby programs
http://doc.chromedshark.com/ruby-audio/
GNU General Public License v2.0
109 stars 27 forks source link

Compilation fails with default compiler flags on Ubuntu 13.10 (at least) #10

Open benalavi opened 10 years ago

benalavi commented 10 years ago

On Ubuntu 13.10 (and possibly other systems with the default compiler flag -Werror=format-security) the gem native extension will fail to build. You can get around this by installing with gem install ruby-audio --with-cflags=-Wno-error=format-security but I suppose the C-extension should be updated to not cause a security error (or at least a note added somewhere, I'm not a C expert so not sure what really should be done to remedy).

lephuongbg commented 10 years ago

I'm also having this problem on Ubuntu 14.04. I just want to add a small fix to your command (if anyone is wondering why it doesn't work, me did also):

gem install ruby-audio -- --with-cflags=-Wno-error=format-security
sp00ck commented 2 years ago

ra_soundinfo.h:11:14: warning: ‘ra_soundinfo_free’ declared ‘static’ but never defined [-Wunused-function] 11 | static void ra_soundinfo_free(SF_INFO info); | ^~~~~ ra_soundinfo.h:14:14: warning: ‘ra_soundinfo_valid’ declared ‘static’ but never defined [-Wunused-function] 14 | static VALUE ra_soundinfo_valid(VALUE self); | ^~~~~~ ra_soundinfo.h:15:14: warning: ‘ra_soundinfo_frames’ declared ‘static’ but never defined [-Wunused-function] 15 | static VALUE ra_soundinfo_frames(VALUE self); | ^~~~~~~ ra_soundinfo.h:16:14: warning: ‘ra_soundinfo_samplerate’ declared ‘static’ but never defined [-Wunused-function] 16 | static VALUE ra_soundinfo_samplerate(VALUE self); | ^~~~~~~ ra_soundinfo.h:17:14: warning: ‘ra_soundinfo_samplerate_set’ declared ‘static’ but never defined [-Wunused-function] 17 | static VALUE ra_soundinfo_samplerate_set(VALUE self, VALUE new_samplerate); | ^~~~~~~ ra_soundinfo.h:18:14: warning: ‘ra_soundinfo_channels’ declared ‘static’ but never defined [-Wunused-function] 18 | static VALUE ra_soundinfo_channels(VALUE self); | ^~~~~ ra_soundinfo.h:19:14: warning: ‘ra_soundinfo_channels_set’ declared ‘static’ but never defined [-Wunused-function] 19 | static VALUE ra_soundinfo_channels_set(VALUE self, VALUE new_channels); | ^~~~~~~~~ ra_soundinfo.h:20:14: warning: ‘ra_soundinfo_format’ declared ‘static’ but never defined [-Wunused-function] 20 | static VALUE ra_soundinfo_format(VALUE self); | ^~~~~~~ ra_soundinfo.h:21:14: warning: ‘ra_soundinfo_format_set’ declared ‘static’ but never defined [-Wunused-function] 21 | static VALUE ra_soundinfo_format_set(VALUE self, VALUE new_format); | ^~~~~~~ ra_soundinfo.h:22:14: warning: ‘ra_soundinfo_sections’ declared ‘static’ but never defined [-Wunused-function] 22 | static VALUE ra_soundinfo_sections(VALUE self); | ^~~~~ ra_soundinfo.h:23:14: warning: ‘ra_soundinfo_seekable’ declared ‘static’ but never defined [-Wunused-function] 23 | static VALUE ra_soundinfo_seekable(VALUE self); | ^~~~~ In file included from ra_sound.h:7, from ra_sound.c:1: ra_buffer.h:24:14: warning: ‘ra_buffer_allocate’ declared ‘static’ but never defined [-Wunused-function] 24 | static VALUE ra_buffer_allocate(VALUE klass); | ^~~~~~ ra_buffer.h:25:14: warning: ‘ra_buffer_free’ declared ‘static’ but never defined [-Wunused-function] 25 | static void ra_buffer_free(RA_BUFFER buf); | ^~~~~~ ra_buffer.h:28:14: warning: ‘ra_buffer_init’ declared ‘static’ but never defined [-Wunused-function] 28 | static VALUE ra_buffer_init(int argc, VALUE argv, VALUE self); | ^~~~~~ ra_buffer.h:29:14: warning: ‘ra_buffer_init_copy’ declared ‘static’ but never defined [-Wunused-function] 29 | static VALUE ra_buffer_init_copy(VALUE copy, VALUE buf); | ^~~~~~~ ra_buffer.h:30:14: warning: ‘ra_buffer_channels’ declared ‘static’ but never defined [-Wunused-function] 30 | static VALUE ra_buffer_channels(VALUE self); | ^~~~~~ ra_buffer.h:31:14: warning: ‘ra_buffer_size’ declared ‘static’ but never defined [-Wunused-function] 31 | static VALUE ra_buffer_size(VALUE self); | ^~~~~~ ra_buffer.h:32:14: warning: ‘ra_buffer_real_size’ declared ‘static’ but never defined [-Wunused-function] 32 | static VALUE ra_buffer_real_size(VALUE self); | ^~~~~~~ ra_buffer.h:33:14: warning: ‘ra_buffer_real_size_set’ declared ‘static’ but never defined [-Wunused-function] 33 | static VALUE ra_buffer_real_size_set(VALUE self, VALUE new_real_size); | ^~~~~~~ ra_buffer.h:34:14: warning: ‘ra_buffer_type’ declared ‘static’ but never defined [-Wunused-function] 34 | static VALUE ra_buffer_type(VALUE self); | ^~~~~~ ra_buffer.h:35:14: warning: ‘ra_buffer_each’ declared ‘static’ but never defined [-Wunused-function] 35 | static VALUE ra_buffer_each(VALUE self); | ^~~~~~ ra_buffer.h:36:14: warning: ‘ra_buffer_aref’ declared ‘static’ but never defined [-Wunused-function] 36 | static VALUE ra_buffer_aref(VALUE self, VALUE index); | ^~~~~~ ra_buffer.h:37:14: warning: ‘ra_buffer_index_get’ declared ‘static’ but never defined [-Wunused-function] 37 | static VALUE ra_buffer_index_get(RA_BUFFER buf, long i); | ^~~~~~~ ra_buffer.h:38:14: warning: ‘ra_buffer_aset’ declared ‘static’ but never defined [-Wunused-function] 38 | static VALUE ra_buffer_aset(VALUE self, VALUE index, VALUE val); | ^~~~~~ ra_buffer.h:39:13: warning: ‘ra_buffer_index_set’ declared ‘static’ but never defined [-Wunused-function] 39 | static void ra_buffer_index_set(RA_BUFFER *buf, long i, VALUE val); | ^~~~~~~ cc1: some warnings being treated as errors make: *** [Makefile:245: ra_sound.o] Błąd 1


fedora