alexkay / spek

Acoustic spectrum analyser
http://spek.cc
GNU General Public License v3.0
2.6k stars 259 forks source link

Cannot compile on fedora 36 #230

Closed arun54321 closed 2 years ago

arun54321 commented 2 years ago
❯ make              
make  all-recursive
make[1]: Entering directory '/tmp/spek-0.8.2'
Making all in data
make[2]: Entering directory '/tmp/spek-0.8.2/data'
Making all in icons
make[3]: Entering directory '/tmp/spek-0.8.2/data/icons'
Making all in 16x16
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/16x16'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/16x16'
Making all in 22x22
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/22x22'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/22x22'
Making all in 24x24
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/24x24'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/24x24'
Making all in 32x32
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/32x32'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/32x32'
Making all in 48x48
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/48x48'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/48x48'
Making all in scalable
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons/scalable'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons/scalable'
make[4]: Entering directory '/tmp/spek-0.8.2/data/icons'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/tmp/spek-0.8.2/data/icons'
make[3]: Leaving directory '/tmp/spek-0.8.2/data/icons'
make[3]: Entering directory '/tmp/spek-0.8.2/data'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/tmp/spek-0.8.2/data'
make[2]: Leaving directory '/tmp/spek-0.8.2/data'
Making all in man
make[2]: Entering directory '/tmp/spek-0.8.2/man'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/tmp/spek-0.8.2/man'
Making all in po
make[2]: Entering directory '/tmp/spek-0.8.2/po'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/tmp/spek-0.8.2/po'
Making all in src
make[2]: Entering directory '/tmp/spek-0.8.2/src'
  CXX    libspek_a-spek-audio.o
spek-audio.cc: In constructor ‘Audio::Audio()’:
spek-audio.cc:82:5: error: ‘av_register_all’ was not declared in this scope
   82 |     av_register_all();
      |     ^~~~~~~~~~~~~~~
spek-audio.cc: In member function ‘std::unique_ptr<AudioFile> Audio::open(const std::string&)’:
spek-audio.cc:105:45: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  105 |             if (format_context->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
      |                                             ^~~~~
spek-audio.cc:120:33: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  120 |         codec_context = stream->codec;
      |                                 ^~~~~
spek-audio.cc:121:37: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  121 |         codec = avcodec_find_decoder(codec_context->codec_id);
      |                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                     |
      |                                     const AVCodec*
spek-audio.cc: In constructor ‘AudioFileImpl::AudioFileImpl(AudioError, AVFormatContext*, int, const std::string&, int, int, int, int, double, bool, int, bool)’:
spek-audio.cc:198:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
  198 |     av_init_packet(&this->packet);
      |     ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/ffmpeg/libavformat/avformat.h:316,
                 from spek-audio.cc:21:
/usr/include/ffmpeg/libavcodec/packet.h:506:6: note: declared here
  506 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
spek-audio.cc:202:19: error: ‘avcodec_alloc_frame’ was not declared in this scope; did you mean ‘avcodec_send_frame’?
  202 |     this->frame = avcodec_alloc_frame();
      |                   ^~~~~~~~~~~~~~~~~~~
      |                   avcodec_send_frame
spek-audio.cc: In destructor ‘virtual AudioFileImpl::~AudioFileImpl()’:
spek-audio.cc:218:9: error: ‘avcodec_free_frame’ was not declared in this scope; did you mean ‘avcodec_send_frame’?
  218 |         avcodec_free_frame(&this->frame);
      |         ^~~~~~~~~~~~~~~~~~
      |         avcodec_send_frame
spek-audio.cc:227:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  227 |         av_free_packet(&this->packet);
      |         ^~~~~~~~~~~~~~
      |         av_new_packet
spek-audio.cc:231:85: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  231 |             auto codec_context = this->format_context->streams[this->audio_stream]->codec;
      |                                                                                     ^~~~~
spek-audio.cc: In member function ‘virtual int AudioFileImpl::read()’:
spek-audio.cc:258:13: error: ‘avcodec_get_frame_defaults’ was not declared in this scope; did you mean ‘avcodec_get_frame_class’?
  258 |             avcodec_get_frame_defaults(this->frame);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |             avcodec_get_frame_class
spek-audio.cc:259:85: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
  259 |             auto codec_context = this->format_context->streams[this->audio_stream]->codec;
      |                                                                                     ^~~~~
spek-audio.cc:261:23: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  261 |             int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet);
      |                       ^~~~~~~~~~~~~~~~~~~~~
      |                       avcodec_decode_subtitle2
spek-audio.cc:302:13: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  302 |             av_free_packet(&this->packet);
      |             ^~~~~~~~~~~~~~
      |             av_new_packet
spek-audio.cc:310:13: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
  310 |             av_free_packet(&this->packet);
      |             ^~~~~~~~~~~~~~
      |             av_new_packet
make[2]: *** [Makefile:448: libspek_a-spek-audio.o] Error 1
make[2]: Leaving directory '/tmp/spek-0.8.2/src'
make[1]: *** [Makefile:368: all-recursive] Error 1
make[1]: Leaving directory '/tmp/spek-0.8.2'
make: *** [Makefile:302: all] Error 2
arun54321 commented 2 years ago

error on master build: https://8n1.org/21394/d085

I already have ffmpeg installed.

❯ ls /usr/include/ffmpeg/libavutil/mem.h
 /usr/include/ffmpeg/libavutil/mem.h
MikeWang000000 commented 2 years ago

Hello, please try my fork MikeWang000000/spek-X :) This version of Spek here uses outdated ffmpeg APIs so it can't compile with FFmpeg 5.

arun54321 commented 2 years ago

@MikeWang000000

2DDouble&)’
  634 |     wxRect2DDouble& operator = (const wxRect2DDouble& rect);
      |                     ^~~~~~~~
  CXX      spek-spek-spectrogram.o
In file included from spek-spectrogram.cc:8:
spek-fft.h:7:10: fatal error: libavutil/mem.h: No such file or directory
    7 | #include <libavutil/mem.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:755: spek-spek-spectrogram.o] Error 1
make[2]: Leaving directory '/tmp/spek-X-main/src'
make[1]: *** [Makefile:479: all-recursive] Error 1
make[1]: Leaving directory '/tmp/spek-X-main'
make: *** [Makefile:407: all] Error 2
MikeWang000000 commented 2 years ago

May be #149? I will take a closer look at this issue later.

raaffaaeell commented 2 years ago

I'm having the same issue and the autogen command didnt help, how did you manage to fix this ?

arun54321 commented 2 years ago

I'm having the same issue and the autogen command didnt help, how did you manage to fix this ?

I just used this https://github.com/MikeWang000000/spek-X