Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling on ubuntu 22.10 #732

Open
p0psicles opened this issue Dec 2, 2022 · 1 comment
Open

Error compiling on ubuntu 22.10 #732

p0psicles opened this issue Dec 2, 2022 · 1 comment

Comments

@p0psicles
Copy link

Has anyone been able to compile attractmode in Ubuntu 22.10?
I'm getting this error:
running make -j $(cat /proc/cpuinfo | grep -c processor)

src/media.cpp:1307:69: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1307 |                                                 m_audio->codec_ctx->channels,
      |                                                                     ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1307:69: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1307 |                                                 m_audio->codec_ctx->channels,
      |                                                                     ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1337:85: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1337 |                                         offset += out_samples * m_audio->codec_ctx->channels;
      |                                                                                     ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1337:85: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1337 |                                         offset += out_samples * m_audio->codec_ctx->channels;
      |                                                                                     ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1337:85: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1337 |                                         offset += out_samples * m_audio->codec_ctx->channels;
      |                                                                                     ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1338:95: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1338 |                                         data.sampleCount += out_samples * m_audio->codec_ctx->channels;
      |                                                                                               ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1338:95: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1338 |                                         data.sampleCount += out_samples * m_audio->codec_ctx->channels;
      |                                                                                               ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
src/media.cpp:1338:95: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
 1338 |                                         data.sampleCount += out_samples * m_audio->codec_ctx->channels;
      |                                                                                               ^~~~~~~~
/usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
make: *** [Makefile:486: obj/media.o] Error 1

i've installed the dependencies with the exception of libavresample-dev. Which isn't available. In stead of that, i've used the package libswresample-dev.

ubuntu:

Distributor ID:	Ubuntu
Description:	Ubuntu 22.10
Release:	22.10
Codename:	kinetic

Attract mode:
version: 2.6.2

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Jan 21, 2023

There's no actual error in your logs, since you can see warning: everywhere; you'll need to scroll up and find the actual error.
If your error mentions something like this:

src/media.cpp:1065:57: error: ‘AVFormatContext’ {aka ‘struct AVFormatContext’} has no member named ‘filename’
 1065 |                                 << m_imp->m_format_ctx->filename << std::endl;
      |                                                         ^~~~~~~~
src/media.cpp:1069:94: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
 1069 |                         AVCodecContext *codec_ctx = m_imp->m_format_ctx->streams[stream_id]->codec;
      |                                                                                              ^~~~~
src/media.cpp:1080:65: error: ‘AVFormatContext’ {aka ‘struct AVFormatContext’} has no member named ‘filename’
 1080 |                                         << m_imp->m_format_ctx->filename << std::endl;
      |                                                                 ^~~~~~~~
src/media.cpp: In member function ‘virtual bool FeMedia::onGetData(sf::SoundStream::Chunk&)’:
src/media.cpp:1223:37: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘refcounted_frames’
 1223 |                 m_audio->codec_ctx->refcounted_frames = 1;
      |                                     ^~~~~~~~~~~~~~~~~
src/media.cpp:1232:27: error: ‘avcodec_decode_audio4’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
 1232 |                 int len = avcodec_decode_audio4( m_audio->codec_ctx, frame, &got_frame, packet );
      |                           ^~~~~~~~~~~~~~~~~~~~~
      |                           avcodec_decode_subtitle2

then this is already fixed.

If you're building against a recent FFmpeg I strongly suggest using 0210824 or newer which has many build fixes implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants