Compilation with g++ broken, was Re: [Ffmpeg-devel] [PATCH] avcodec.h should include stdint.h

Måns Rullgård mans
Fri Mar 9 16:09:19 CET 2007


Ismail D?nmez said:
> On Friday 09 March 2007 16:43:29 Diego Biurrun wrote:
>> On Fri, Mar 09, 2007 at 04:33:29PM +0200, Ismail D??nmez wrote:
>> > avcodec.h uses INT64_C macro but not include stdint.h, either it
>> > shouldn't use that macro or should include stdint.h . Attached patch does
>> > the latter.
>>
>> It includes inttypes.h via avutil.h and common.h.  Supposedly inttypes.h
>> includes stdint.h, it does on my glibc system ...
>
> Ok looks like only g++ is effected:
>
> [~]> cat test.cpp
> #include <ffmpeg/avformat.h>
> #include <ffmpeg/avcodec.h>
>
> main() {
> }
>
> [~]> g++ -c test.cpp
> In file included from test.cpp:2:
> /usr/include/ffmpeg/avformat.h: In function 'void av_init_packet(AVPacket*)':
> /usr/include/ffmpeg/avformat.h:66: error: 'INT64_C' was not declared in this
> scope
>
> Ideas?

In C++ you need to define some macro before including stdint.h to get some of
the things is provides, this macro among them.  I forget the details, but
IIRC it has been mentioned on this list previously.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list