tony2001 / ffmpeg-php

PHP extension for video editing, wrapping ffmpeg
GNU General Public License v2.0
84 stars 62 forks source link

error: expected specifier-qualifier-list before ‘time_t’ #9

Closed yousefdawod closed 10 years ago

yousefdawod commented 10 years ago

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /bin/sh /home/share/ffmpeg-php/libtool --mode=compile cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -o ffmpeg-php.lo libtool: compile: cc -I. -I/home/share/ffmpeg-php -DPHP_ATOM_INC -I/home/share/ffmpeg-php/include -I/home/share/ffmpeg-php/main -I/home/share/ffmpeg-php -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/share/ffmpeg-php/ffmpeg-php.c -fPIC -DPIC -o .libs/ffmpeg-php.o In file included from /usr/include/sys/stat.h:107, from /usr/include/php/main/php_streams.h:28, from /usr/include/php/main/php.h:395, from /home/share/ffmpeg-php/ffmpeg-php.c:40: /usr/include/bits/stat.h:91: error: field ‘st_atim’ has incomplete type /usr/include/bits/stat.h:92: error: field ‘st_mtim’ has incomplete type /usr/include/bits/stat.h:93: error: field ‘st_ctim’ has incomplete type /usr/include/bits/stat.h:152: error: field ‘st_atim’ has incomplete type /usr/include/bits/stat.h:153: error: field ‘st_mtim’ has incomplete type /usr/include/bits/stat.h:154: error: field ‘st_ctim’ has incomplete type In file included from /usr/include/php/main/php_streams.h:28, from /usr/include/php/main/php.h:395, from /home/share/ffmpeg-php/ffmpeg-php.c:40: /usr/include/sys/stat.h:367: error: array type has incomplete element type /usr/include/sys/stat.h:374: error: array type has incomplete element type In file included from /usr/include/php/main/php.h:401, from /home/share/ffmpeg-php/ffmpeg-php.c:40: /usr/include/php/TSRM/tsrm_virtual_cwd.h:218: error: expected specifier-qualifier-list before ‘time_t’ /usr/include/php/TSRM/tsrm_virtual_cwd.h:246: error: expected declaration specifiers or ‘...’ before ‘time_t’ make: *\ [ffmpeg-php.lo] Error 1

tony2001 commented 10 years ago

None of these structs are used in ffmpeg-php.c: $ cat ffmpeg-php.c | grep stat statement from your version. $ cat ffmpeg-php.c | grep time_t $

Make sure the headers are alright, especially the PHP headers, since /usr/include/php/ instead of /usr/include/php5 looks suspicious to me.

yousefdawod commented 10 years ago

[root@localhost ffmpeg-php]# cat ffmpeg-php.c | grep stat statement from your version. [root@localhost ffmpeg-php]# cat ffmpeg-php.c | grep time_t [root@localhost ffmpeg-php]#

I do not have a folder /usr/include/php5

tony2001 commented 10 years ago

How did you install PHP? Using some packets? or did you build it yourself?

tony2001 commented 10 years ago

Also some more info about your system would be nice to have.

yousefdawod commented 10 years ago

Centos 6.5 [root@localhost ~]# php -v PHP 5.5.16 (cli) (built: Aug 22 2014 05:42:56) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

yousefdawod commented 10 years ago

I had version 5.5.3 and the same problem and I did an update to the latest version

tony2001 commented 10 years ago

Make sure the headers actually belong to the same PHP version. rpm -qf /usr/include/php should be enough

yousefdawod commented 10 years ago

[root@localhost ~]# rpm -qf /usr/include/php php55w-devel-5.5.16-1.w6.x86_64

tony2001 commented 10 years ago

And are you able to build any other PECL extension?

tony2001 commented 10 years ago

Ah, wait. I've recalled that there was a similar issue previously: https://github.com/tony2001/ffmpeg-php/issues/1 What's your ffmpeg version?

yousefdawod commented 10 years ago

ffmpeg 2.2.3

tony2001 commented 10 years ago

And are you using the extension sources from this very repository? I'm able to reproduce your issue only if I revert the patches for the issue #1.

yousefdawod commented 10 years ago

From here the steps to install the ffmpeg http://www.cpanelkb.net/install-ffmpeg-mplayer-mencoder-mp4box-flvtool2/

I'm able to reproduce your issue only if I revert the patches for the issue #1.

Do I edit the files and is it modified in this version I have?

tony2001 commented 10 years ago

Well, you've downloaded ffmpeg-php from the old, now defunct Sourceforge project. But this project is on Github and is a fork of that old SF project. Reporting issues in the old SF code makes no sense, use the sources from this repo and then report any issues you've encountered (if any).

yousefdawod commented 10 years ago

I currently use the your version and not Sourceforge I skip this step in the site because it did not work well

tony2001 commented 10 years ago

This particular problem was addressed in issue #1, so I can't see how you can use my version and still see the error. Show me what you get with cat ffmpeg-php.c | grep include

yousefdawod commented 10 years ago

Thanks for your help Now everything is good but there is a problem it seems is not compatible with the latest version

cat ffmpeg-php.c | grep include

give you permission to combine ffmpeg-php with code included in the of the other code concerned, provided that you include the source code of

include "config.h"

include "php.h"

include <libavcodec/avcodec.h>

include <libavformat/avformat.h>

include <libswscale/swscale.h>

include "php_ini.h"

include "php_globals.h"

include "ext/standard/info.h"

include "php_ffmpeg.h"

include "ffmpeg_errorhandler.h"

++++++++++++++++++++++++++++++++++++++++++++++++++

php -v

PHP Warning: PHP Startup: ffmpeg: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20121212 These options need to match in Unknown on line 0 PHP 5.5.16 (cli) (built: Aug 22 2014 05:42:56) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

tony2001 commented 10 years ago

You have old (PHP 5.3) headers installed in your system. Remove them (probably php-devel packet or something similar) and install PHP 5.5 headers instead. You'll have to rebuild the extension after that