My favorites | Sign in
Project Home Downloads Wiki Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 11: 'UINT64_C' was not declared in this scope
12 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  May 2010


Sign in to add a comment
 
Reported by yxml...@gmail.com, May 2, 2010
Configuration information there is detailed information in the info.txt


In file included from D:/WinLinux/Minsys/local/include/libavutil/
avutil.h:81,
                 from D:/WinLinux/Minsys/local/include/libavcodec/
avcodec.h:30,
                 from D:/WinLinux/Minsys/local/include/libavformat/
avformat.h:56
,
                 from src/core/audiosource.h:25,
                 from src/core/audiosource.cpp:21:
D:/WinLinux/Minsys/local/include/libavutil/common.h: In function 'int32_t 
av_clipl_int32(int64_t)':
D:/WinLinux/Minsys/local/include/libavutil/common.h:154: error: 'UINT64_C' 
was not declared in this scope
make: *** [src/core/audiosource.lo] Error 1
info.txt
5.2 KB   View   Download
May 3, 2010
#1 rotmer@gmail.com
The same issue i'm getting here when compiling chromium with ffmpeg from svn:

In file included from /usr/include/libavutil/avutil.h:81:0,
                 from /usr/include/libavcodec/avcodec.h:30,
                 from out/Release/obj.target/geni/ffmpeg_stubs.cc:16:
/usr/include/libavutil/common.h: In function 'int32_t av_clipl_int32(int64_t)':
/usr/include/libavutil/common.h:154:47: error: 'UINT64_C' was not declared in this scope
make: *** [out/Release/obj.target/geni/ffmpeg_stubs.o] Error 1

May 3, 2010
#2 rotmer@gmail.com
Uh, just got here from google, seems like its not the best place to report this 
issue.. Anyway :).
May 3, 2010
Project Member #3 kalle.bl...@gmail.com
Was fixed in r311.
Status: Fixed
Jun 14, 2010
#4 redf35...@gmail.com
getting this same error when trying to build zoneminder 1.24.2.  pulled the latest ffmpeg source June 14th 2010 well after this issue was suppose to be resolved.


Jun 16, 2010
#5 pierrelu...@gmail.com
I'm also getting it in r23634.

/usr/local/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/local/include/libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope

Jun 22, 2010
Project Member #6 kalle.bl...@gmail.com
This should be fixed in our build system no matter what version of ffmpeg you're using. If you're still getting it, run configure like so:
CFLAGS=-D__STDC_CONSTANT_MACROS ./configure
and your problems should go away. This applies to other C++ programs using ffmpeg as well and not just to ffms2, but I can't guarantee that other programs won't break if you define that macro (they really shouldn't, though).
Labels: OpSys-Windows
Jun 22, 2010
Project Member #7 kalle.bl...@gmail.com
(No comment was entered for this change.)
Labels: -OpSys-Windows
Aug 17, 2010
Project Member #8 kalle.bl...@gmail.com
Clarification (since this is apparently a common problem and shows up pretty high in google searches): it should be CXXFLAGS, not CFLAGS.
Sep 15, 2010
#9 apzc2...@gmail.com
Thank you! CXXFLAGS=-D__STDC_CONSTANT_MACROS works!
Nov 1, 2010
#11 shekatsu...@gmail.com
What about adding this:
#ifdef __cplusplus
 #define __STDC_CONSTANT_MACROS
 #ifdef _STDINT_H
  #undef _STDINT_H
 #endif
 # include <stdint.h>
#endif

to the common.h code?
Nov 4, 2010
Project Member #12 kalle.bl...@gmail.com
I think you're in the wrong project, bro.
Nov 7, 2010
#13 mrtux....@gmail.com
adding this before #include <libav....>
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif

Nov 7, 2010
Project Member #14 kalle.bl...@gmail.com
Stop posting in this issue, it's been worked around in our build system for ages. Go complain at the ffmpeg fags if you want it fixed there (hint: they won't do shit).
Nov 8, 2010
#16 asmith5...@gmail.com
Their (ffmpeg fags) solution is to move to x86_64.
Dec 27, 2010
#17 luca.bar...@gmail.com
Complain with the C++ Standard.

PS: be grateful we do not put int class; struct new; in the public headers just for fun.
Oct 22, 2011
#18 walt.j.w...@gmail.com
Can someone offer some help here: 

I'm still getting this error, even after typing "CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure" at the command line.  I'm using Ubuntu 11.04 (natty) and openCV 2.3.1.

the make output looks like: 
.
.
[ 67%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
In file included from /usr/include/libavutil/avutil.h:81:0,
                 from /usr/include/libavcodec/avcodec.h:30,
                 from /usr/include/libavformat/avformat.h:56,
                 from /home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:97:
/usr/include/libavutil/common.h: In function ‘int32_t av_clipl_int32(int64_t)’:
/usr/include/libavutil/common.h:154:47: error: ‘UINT64_C’ was not declared in this scope
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:546:9: warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:548:54: warning: ‘int avcodec_decode_video(AVCodecContext*, AVFrame*, int*, const uint8_t*, int)’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3452)
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:1203:8: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:1203:41: warning: ‘AVOutputFormat* guess_format(const char*, const char*, const char*)’ is deprecated (declared at /usr/include/libavformat/avformat.h:787)
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:1217:7: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/libavformat/avformat.h:947)
/home/walt/src/opencv/src/highgui/cvcap_ffmpeg.cpp:1217:31: warning: ‘AVFormatContext* av_alloc_format_context()’ is deprecated (declared at /usr/include/libavformat/avformat.h:947)
make[2]: *** [src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o] Error 1
make[1]: *** [src/highgui/CMakeFiles/highgui.dir/all] Error 2
make: *** [all] Error 2

I've also seen here (https://bugs.launchpad.net/ubuntu/+source/opencv/+bug/685500)  that C++ Applications including FFmpeg Headers need to define
__STDC_LIMIT_MACROS before including libavutil headers. After the above recommendation didn't work (CXXFLAGS...) I defined __STDC_LIMIT_MACROS as TRUE in the CMakeLists.txt but still get the same error when doing a make.  

any help is much appreciated, and thanks in advance,

Walt 
 
Oct 22, 2011
Project Member #19 kalle.bl...@gmail.com
you're on the wrong bugtracker, bro
Oct 23, 2011
#20 walt.j.w...@gmail.com
Kalle, can you point to a location where this is solved?  Looks like several other posts here are regarding this exact topic.  If you know of a more appropriate location to discuss this, how about including a link to it.  

When I using the "work around" in the build system I still get the same problem stated above...  if ffmpeg guys aren't doing anything to fix this, it looks like there is an opportunity (and need) to clarify the solution to make this work correctly, and this looks like the right location to do that.

thanks in advance,
Walt 

Oct 25, 2011
Project Member #21 kalle.bl...@gmail.com
The unfortunate fact that this bug report shows up near the top of search results for queries like "ffmpeg UINT64_C not defined" does not make it "the right location" to ask questions about a vaguely related problem with a similar error message that appears in a completely unrelated software package.

Just in case it wasn't clear, let me point out that this is not the opencv issue tracker. It is not the ffmpeg issue tracker, either. It is the issue tracker for the library known as ffmpegsource (or ffms2), and the purpose of it is to track bugs and other issues in that library, and that library only. Your issue, on the other hand, does not have anything to do with ffmpegsource, and prior to your post I had never heard about the library you are having problems with. I cannot solve your issue for you, nor am I in any better position to find a solution elsewhere than you are.

All of that being said, I can at least give you one general hint. Your problem is almost certainly caused by __STDC_CONSTANT_MACROS not being defined at the point in the build process where libavutil/common.h tries to #include <stdint.h>. Find a way to make it defined at that point and your problem will most likely go away. Since I have no experience whatsoever with the library you are attempting to build and very little experience with its build system, I have no suggestions on how to accomplish that.

This is as far as I can help you; now go forth and seek help elsewhere.
Aug 26, 2013
#22 hot9...@yahoo.com.tw
you need 
extern "C"{

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

}

bro,
Jan 2, 2014
#23 bernat...@gmail.com
haha, 2014 and I still have this issue. Anyway #13 has the correct answer.
Mar 17, 2014
#24 yyponylo...@gmail.com
I alse have this issue in android with arm compiler.
I have tried #6,that is, add the following in the Android.mk:
LOCAL_CFLAGS += -D__STDC_CONSTANT_MACROS=1

It works!
refer to:
http://www.ynjan.com/?p=560&lang=en
Mar 18, 2014
#25 Weix...@gmail.com
#13
dashen
Sign in to add a comment

Powered by Google Project Hosting