Skip to content

Error compiling 0.3.1 and 0.3.2 in manjaro #60

@lucamini

Description

@lucamini

Hi,
I'm very sorry but in the last I'm not able to compile the 0.3.2 tar ball and neither the 0.3.1 version available in the AUR repository, due to the following error:

peakgen.c:241:9: error: unknown type name ‘AVCodecContext’
241 | AVCodecContext* encoder;
| ^~~~~~~~~~~~~~
peakgen.c:281:14: error: unknown type name ‘AVCodecContext’; did you mean ‘AVIODirContext’?
281 | open_audio2 (AVCodecContext* c, AVStream* stream, OutputStream* ost)
| ^~~~~~~~~~~~~~
| AVIODirContext
peakgen.c: In function ‘wf_ff_peakgen’:
peakgen.c:344:26: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
344 | AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);
| ^~~~~~~~~~~~~~~~~~~~
peakgen.c:358:9: error: unknown type name ‘AVCodecContext’; use ‘struct’ keyword to refer to the type
358 | AVCodecContext* c = output_stream.encoder = avcodec_alloc_context3(codec);
| ^~~~~~~~~~~~~~
| struct
peakgen.c:358:53: warning: implicit declaration of function ‘avcodec_alloc_context3’; did you mean ‘avio_alloc_context’? [-Wimplicit-function-declaration]
358 | AVCodecContext* c = output_stream.encoder = avcodec_alloc_context3(codec);
| ^~~~~~~~~~~~~~~~~~~~~~
| avio_alloc_context
peakgen.c:358:51: warning: assignment to ‘int ’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
358 | AVCodecContext
c = output_stream.encoder = avcodec_alloc_context3(codec);
| ^
peakgen.c:364:10: error: request for member ‘sample_fmt’ in something not a structure or union
364 | c->sample_fmt = codec->sample_fmts ? codec->sample_fmts[0] : AV_SAMPLE_FMT_S16;
| ^~
peakgen.c:365:10: error: request for member ‘sample_rate’ in something not a structure or union
365 | c->sample_rate = f.info.sample_rate;
| ^~
peakgen.c:366:10: error: request for member ‘channel_layout’ in something not a structure or union
366 | c->channel_layout = codec->channel_layouts ? codec->channel_layouts[0] : (f.info.channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO);
| ^~
peakgen.c:366:106: error: ‘AV_CH_LAYOUT_STEREO’ undeclared (first use in this function)
366 | youts ? codec->channel_layouts[0] : (f.info.channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO);
| ^~~~~~~~~~~~~~~~~~~

peakgen.c:366:106: note: each undeclared identifier is reported only once for each function it appears in
peakgen.c:366:128: error: ‘AV_CH_LAYOUT_MONO’ undeclared (first use in this function)
366 | _layouts[0] : (f.info.channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO);
| ^~~~~~~~~~~~~~~~~

peakgen.c:367:10: error: request for member ‘channels’ in something not a structure or union
367 | c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
| ^~
peakgen.c:367:29: warning: implicit declaration of function ‘av_get_channel_layout_nb_channels’ [-Wimplicit-function-declaration]
367 | c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
peakgen.c:367:64: error: request for member ‘channel_layout’ in something not a structure or union
367 | c->channels = av_get_channel_layout_nb_channels(c->channel_layout);
| ^~

peakgen.c:368:10: error: request for member ‘bit_rate’ in something not a structure or union
368 | c->bit_rate = f.info.sample_rate * 16 * f.info.channels;
| ^~
peakgen.c:370:47: error: request for member ‘sample_rate’ in something not a structure or union
370 | stream->time_base = (AVRational){ 1, c->sample_rate };
| ^~
peakgen.c:374:18: error: request for member ‘flags’ in something not a structure or union
374 | c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~
peakgen.c:374:29: error: ‘AV_CODEC_FLAG_GLOBAL_HEADER’ undeclared (first use in this function)
374 | c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
peakgen.c:376:9: warning: implicit declaration of function ‘open_audio2’ [-Wimplicit-function-declaration]
376 | open_audio2(c, stream, &output_stream);
| ^~~~~~~~~~~
peakgen.c:510:9: warning: implicit declaration of function ‘avcodec_free_context’; did you mean ‘avformat_free_context’? [-Wimplicit-function-declaration]
510 | avcodec_free_context(&output_stream.encoder);
| ^~~~~~~~~~~~~~~~~~~~
| avformat_free_context
peakgen.c: In function ‘wf_ff_peakgen_split_stereo’:
peakgen.c:583:26: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
583 | AVCodec* codec = avcodec_find_encoder(AV_CODEC_ID_PCM_S16LE);
| ^~~~~~~~~~~~~~~~~~~~
peakgen.c:597:9: error: unknown type name ‘AVCodecContext’; use ‘struct’ keyword to refer to the type
597 | AVCodecContext* c = output_stream.encoder = avcodec_alloc_context3(codec);
| ^~~~~~~~~~~~~~
| struct
peakgen.c:597:51: warning: assignment to ‘int ’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
597 | AVCodecContext
c = output_stream.encoder = avcodec_alloc_context3(codec);
| ^
peakgen.c:603:10: error: request for member ‘sample_fmt’ in something not a structure or union
603 | c->sample_fmt = codec->sample_fmts ? codec->sample_fmts[0] : AV_SAMPLE_FMT_S16;
| ^~
peakgen.c:604:10: error: request for member ‘sample_rate’ in something not a structure or union
604 | c->sample_rate = f.info.sample_rate;
| ^~
peakgen.c:605:10: error: request for member ‘channel_layout’ in something not a structure or union
605 | c->channel_layout = AV_CH_LAYOUT_STEREO;
| ^~
peakgen.c:605:29: error: ‘AV_CH_LAYOUT_STEREO’ undeclared (first use in this function)
605 | c->channel_layout = AV_CH_LAYOUT_STEREO;
| ^~~~~~~~~~~~~~~~~~~
peakgen.c:606:10: error: request for member ‘channels’ in something not a structure or union
606 | c->channels = 2;
| ^~
peakgen.c:607:10: error: request for member ‘bit_rate’ in something not a structure or union
607 | c->bit_rate = f.info.sample_rate * 16 * f.info.channels;
| ^~
peakgen.c:609:47: error: request for member ‘sample_rate’ in something not a structure or union
609 | stream->time_base = (AVRational){ 1, c->sample_rate };
| ^~
peakgen.c:613:18: error: request for member ‘flags’ in something not a structure or union
613 | c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~
peakgen.c:613:29: error: ‘AV_CODEC_FLAG_GLOBAL_HEADER’ undeclared (first use in this function)
613 | c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions