problem compiling OF_prelease_v0061 on 64-bit Debian

Hi,

I am trying to compile of_preRelease_v0061_linux64_FAT on debian squeeze/testing on a 64-bit system. Running install-dependencies fro the scripts/linux/debian directory fails when attempting to compile the Debug build “make Debug” with the following output:

…/…/…/openFrameworks/video/ofUCUtils.cpp:19:22: warning: avformat.h: No such file or directory
…/…/…/openFrameworks/video/ofUCUtils.cpp:20:21: warning: swscale.h: No such file or directory
In file included from /usr/include/libavutil/avutil.h:81,
from /usr/include/libavcodec/avcodec.h:30,
from /usr/include/libavformat/avformat.h:56,
from …/…/…/openFrameworks/video/ofUCUtils.cpp:21:
/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope
…/…/…/openFrameworks/video/ofUCUtils.cpp: In member function ‘void ofUCUtils::new_frame(unicap_data_buffer_t*)’:
…/…/…/openFrameworks/video/ofUCUtils.cpp:389: error: invalid conversion from ‘int’ to ‘PixelFormat’
…/…/…/openFrameworks/video/ofUCUtils.cpp:389: error: initializing argument 3 of ‘int avpicture_fill(AVPicture*, uint8_t*, PixelFormat, int, int)’
make: *** [obj/Debug/openFrameworks/video/ofUCUtils.o] Error 1
there has been a problem compiling Debug OF library

I do have libavformat-dev and libswscale-dev properly installed. It seems that the following two issues point to issues with the code:

/usr/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope
I wonder if avformat is 64-bit compatible

…/…/…/openFrameworks/video/ofUCUtils.cpp:389: error: invalid conversion from ‘int’ to ‘PixelFormat’
…/…/…/openFrameworks/video/ofUCUtils.cpp:389: error: initializing argument 3 of ‘int avpicture_fill(AVPicture*, uint8_t*, PixelFormat, int, int)’
this seems like a type cast is missing in the OF code base itself.

Any help is appreciated, thanks!

the last two errors are a known issue with latest versions of ffmpeg, and are already solved in github:

http://github.com/openframeworks/openFrameworks

i haven’t seen the UINT64 errors before, can you try with the github version and report if the problem is still there?

also ofUCutils are not really used anymore so by deleting them you should solve the problem.

The UINT64_C error appears in the github code base as well.

Adding -D__STDC_CONSTANT_MACROS to the compilation flags (USERFLAGS) solves the UINT64_c problem.

I got this suggestion from this ffmpeg irc log:
http://lists.mplayerhq.hu/pipermail/ffm-…-00090.html

I only skimmed through it, but it seems libavutil doesn’t conform to the C++ standard. I don’t know if this define is an acceptable fix or a temporary workaround.

what flavor of g++/glibc do you have and do not see the problem? I have gcc version 4.4.4 (Debian 4.4.4-1) but don’t remember my glibc version

i suppose you have a newer version of ffmpeg being in debian testing, i’m using ubuntu. btw, do you need this flag only to compile the OF library or also for the examples?

I received the UINT64_C error when trying to run an 0.06 app on Ubuntu 10.10

It seems to be a problem with FFMPEG.
I solved the problem by adding this to the top of libavutil/common.h:

  
  
#ifdef __cplusplus  
#define __STDC_CONSTANT_MACROS  
#ifdef _STDINT_H  
#undef _STDINT_H  
#endif  
# include <stdint.h>  
#endif  
  

See this link:
http://sirivy.wordpress.com/2010/10/14/-…-his-scope/