Menu

#59 Compile against newer ffmpeg fails because of avutil/time.h

release
open
nobody
None
5
2015-01-19
2014-04-20
No

Compiling this extension against a newer ffmpeg library (at least the one on ubuntu trusty) aborts with the following errors:

In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:105:0,
from /usr/include/php5/main/php_streams.h:28,
from /usr/include/php5/main/php.h:395,
from /root/ffmpeg-php-0.7.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/bits/stat.h:91:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; / Time of last access. /
^
/usr/include/x86_64-linux-gnu/bits/stat.h:92:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; / Time of last modification. /
^
/usr/include/x86_64-linux-gnu/bits/stat.h:93:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; / Time of last status change. /
^
/usr/include/x86_64-linux-gnu/bits/stat.h:152:21: error: field 'st_atim' has incomplete type
struct timespec st_atim; / Time of last access. /
^
/usr/include/x86_64-linux-gnu/bits/stat.h:153:21: error: field 'st_mtim' has incomplete type
struct timespec st_mtim; / Time of last modification. /
^
/usr/include/x86_64-linux-gnu/bits/stat.h:154:21: error: field 'st_ctim' has incomplete type
struct timespec st_ctim; / Time of last status change. /
^
In file included from /usr/include/php5/main/php_streams.h:28:0,
from /usr/include/php5/main/php.h:395,
from /root/ffmpeg-php-0.7.0/ffmpeg-php.c:40:
/usr/include/x86_64-linux-gnu/sys/stat.h:365:31: error: array type has incomplete element type
const struct timespec times[2],
^
/usr/include/x86_64-linux-gnu/sys/stat.h:372:54: error: array type has incomplete element type
extern int futimens (int
fd, const struct timespec times[2]) THROW;
^
In file included from /usr/include/php5/main/php.h:401:0,
from /root/ffmpeg-php-0.7.0/ffmpeg-php.c:40:
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:218:2: error: unknown type name 'time_t'
time_t expires;
^
/usr/include/php5/TSRM/tsrm_virtual_cwd.h:246:86: error: unknown type name 'time_t'
CWD_API realpath_cache_bucket realpath_cache_lookup(const char path, int path_len, time_t t TSRMLS_DC);
^
/root/ffmpeg-php-0.7.0/ffmpeg-php.c: In function 'zm_info_ffmpeg':
/root/ffmpeg-php-0.7.0/ffmpeg-php.c:194:38: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
m_codec_list[m_codec_list_len] = (char)NULL;
^

Found the solution to the problem here:
http://trac.osgeo.org/grass/ticket/2017#comment:12

The reason is that /usr/include/libavutil already contains time.h header file
It appears that they really don't want anyone else to use their library.

I've implemented the suggestions as made in http://trac.osgeo.org/grass/ticket/2017#comment:13

Apply the patchfile as attached to solve this problem.

1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.