'UINT64_C' was not declared in this scope #11

Closed
tgoyne opened this Issue Aug 19, 2013 · 19 comments

Comments

Projects
None yet
1 participant
Owner

tgoyne commented Aug 19, 2013

From yxmline on May 02, 2010 05:28:36

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

Attachment: info.txt

Original issue: http://code.google.com/p/ffmpegsource/issues/detail?id=11

Owner

tgoyne commented Aug 19, 2013

From rotmer on May 03, 2010 06:49:04

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

Owner

tgoyne commented Aug 19, 2013

From rotmer on May 03, 2010 06:50:46

Uh, just got here from google, seems like its not the best place to report this
issue.. Anyway :).

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on May 03, 2010 14:12:31

Was fixed in r311 .

Status: Fixed

Owner

tgoyne commented Aug 19, 2013

From redf35097 on June 14, 2010 06:33:30

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.

Owner

tgoyne commented Aug 19, 2013

From pierrelucbacon on June 16, 2010 15:40:12

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

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on June 22, 2010 01:42:54

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

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on June 22, 2010 01:59:19

Labels: -OpSys-Windows

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on August 17, 2010 16:44:18

Clarification (since this is apparently a common problem and shows up pretty high in google searches): it should be CXXFLAGS, not CFLAGS.

Owner

tgoyne commented Aug 19, 2013

From apzc2529 on September 15, 2010 18:23:44

Thank you! CXXFLAGS=-D__STDC_CONSTANT_MACROS works!

Owner

tgoyne commented Aug 19, 2013

From shekatsu8er on November 01, 2010 09:09:39

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?

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on November 04, 2010 03:32:46

I think you're in the wrong project, bro.

Owner

tgoyne commented Aug 19, 2013

From mrtux.hdb on November 07, 2010 10:11:19

adding this before #include <libav....>
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on November 07, 2010 10:55:31

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).

Owner

tgoyne commented Aug 19, 2013

From asmith5152 on November 08, 2010 01:50:35

Their (ffmpeg fags) solution is to move to x86_64.

Owner

tgoyne commented Aug 19, 2013

From luca.barbato on December 27, 2010 10:56:51

Complain with the C++ Standard.

PS: be grateful we do not put int class; struct new; in the public headers just for fun.

Owner

tgoyne commented Aug 19, 2013

From walt.j.white on October 22, 2011 12:12:02

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

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on October 22, 2011 20:53:27

you're on the wrong bugtracker, bro

Owner

tgoyne commented Aug 19, 2013

From walt.j.white on October 23, 2011 05:09:25

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

Owner

tgoyne commented Aug 19, 2013

From kalle.blomster on October 25, 2011 18:00:45

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.

tgoyne closed this Aug 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment