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

Compile error Attract Mode 2.6.2 on Arch Linux #727

Open
shbon opened this issue Jul 25, 2022 · 3 comments
Open

Compile error Attract Mode 2.6.2 on Arch Linux #727

shbon opened this issue Jul 25, 2022 · 3 comments

Comments

@shbon
Copy link

shbon commented Jul 25, 2022

Trying to compile Attract Mode 2.6.2 on up to date Arch Linux...

**
Edit: I can see there were 3 commits just after v2.6.2 to media.cpp:

Update src/media.cpp to use modern FFmpeg API:
https://github.com/mickelson/attract/commit/1b933c39dbd9201b09140e922babe21939d64dad

Fix build issue with recent ffmpeg:
https://github.com/mickelson/attract/commit/c27312be47dfb7370456a878fc6284883650b7f2

Only use const AVCodec where AVFORMAT version >= 59.0.100
https://github.com/mickelson/attract/commit/02108245be47fc8adc92b42059ab8f30b340f16e

So as a workaround, I downloaded and compiled the source from this commit point:
https://github.com/mickelson/attract/tree/02108245be47fc8adc92b42059ab8f30b340f16e

That worked.
**

I get the following error (snippet):

flags: -Wl,--export-dynamic -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread  -DDATA_PATH=\"/usr/local/share/attract/\" -O2 -DNDEBUG -Iextlibs/audio/include -D__STDC_CONSTANT_MACROS -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread -I/usr/include/AL  -Iextlibs/squirrel/include -Iextlibs/sqrat/include -Iextlibs/nowide -Iextlibs/nvapi -Iextlibs/rapidjson/include -Iextlibs/gameswf -DUSE_XLIB -DUSE_XINERAMA -DUSE_FONTCONFIG -DUSE_LIBARCHIVE -DUSE_LIBCURL -DUSE_SWRESAMPLE
Compiling obj/media.o...
src/media.cpp: In member function ‘void FeVideoImp::video_thread()’:
src/media.cpp:660:52: error: ‘AVCodecContext’ {aka ‘struct AVCodecContext’} has no member named ‘refcounted_frames’
  660 |                                         codec_ctx->refcounted_frames = 1;
      |                                                    ^~~~~~~~~~~~~~~~~
src/media.cpp:665:51: error: ‘avcodec_decode_video2’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
  665 |                                         int len = avcodec_decode_video2( codec_ctx, raw_frame,
      |                                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                                   avcodec_decode_subtitle2
src/media.cpp:672:77: error: ‘AVFrame’ {aka ‘struct AVFrame’} has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?
  672 |                                                 raw_frame->pts = raw_frame->pkt_pts;
      |                                                                             ^~~~~~~
      |                                                                             pkt_dts
src/media.cpp:732:78: error: ‘AVFormatContext’ {aka ‘struct AVFormatContext’} has no member named ‘filename’
  732 |         FeDebug() << "End Video Thread - " << m_parent->m_imp->m_format_ctx->filename << std::endl
      |                                                                              ^~~~~~~~
src/media.cpp: In static member function ‘static void FeMedia::init_av()’:
src/media.cpp:762:17: error: ‘avcodec_register_all’ was not declared in this scope
  762 |                 avcodec_register_all();
      |                 ^~~~~~~~~~~~~~~~~~~~
src/media.cpp:763:17: error: ‘av_register_all’ was not declared in this scope
  763 |                 av_register_all();
      |                 ^~~~~~~~~~~~~~~

Is this a FFmpeg version issue?

I have ffmpeg 5.0.1 and ffmpeg 4.4.2 installed via the arch repository:

libavcodec for instance:
FFmpeg 4.4.2: usr/lib/libavcodec.so.58.134.100
FFmpeg 5.0.1: usr/lib/libavcodec.so.59.18.100

Any thoughts?

Thanks
Shaun

@shbon shbon changed the title Compiling Attract Mode 2.6.2 on Arch Linux Compile Error Attract Mode 2.6.2 on Arch Linux Jul 25, 2022
@shbon shbon changed the title Compile Error Attract Mode 2.6.2 on Arch Linux Compile error Attract Mode 2.6.2 on Arch Linux Jul 25, 2022
@OzFalcon
Copy link
Contributor

OzFalcon commented Aug 8, 2022

No problems compiling the latest master with Debian system.
ffmpeg -version
ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers

Sure you have the 4.4.2 dev files installed?
Can you compile using 4.4.2 only using something like https://wiki.debian.org/DebianAlternatives

@kwyxz
Copy link

kwyxz commented Aug 21, 2022

No problems compiling the latest master with Debian system. ffmpeg -version ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers

There will be an issue since avcodec_decode_audio4 was deprecated with ffmpeg version 5 which will be in the next Debian stable too (already is in Sid).

@eclairevoyant
Copy link
Contributor

eclairevoyant commented Jan 21, 2023

https://aur.archlinux.org/packages/attract
use this or the -git package. The build issues have already been resolved upstream

By the way, since this is no longer an issue for you, you should close this issue to save maintainers from having to check resolved issues

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

4 participants