LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-06-2006, 05:21 PM   #1
mrchaos
Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware current, Fedora Core 5, SuSE 10.1 OSS
Posts: 298

Rep: Reputation: 30
ffmpeg won't build properly


I have kernel 2.6.11.8, and when I try to build ffmpeg, I get:
Code:
bash-3.00# make
make -C libavutil all
make[1]: Entering directory `/home/zax/main/ffmpeg/libavutil'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/zax/main/ffmpeg/libavutil'
make -C libavcodec all
make[1]: Entering directory `/home/zax/main/ffmpeg/libavcodec'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/zax/main/ffmpeg/libavcodec'
make -C libavformat all
make[1]: Entering directory `/home/zax/main/ffmpeg/libavformat'
gcc -O3 -g -Wall -Wno-switch  -Wdeclaration-after-statement -I.. -I'/home/zax/main/ffmpeg' -I'/home/zax/main/ffmpeg'/libavutil -I'/home/zax/main/ffmpeg'/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE  -c -o v4l2.o v4l2.c
v4l2.c:68: error: `V4L2_PIX_FMT_YUV420' undeclared here (not in a function)
v4l2.c:68: error: initializer element is not constant
v4l2.c:68: error: (near initialization for `fmt_conversion_table[0].v4l2_fmt')
v4l2.c:69: error: initializer element is not constant
v4l2.c:69: error: (near initialization for `fmt_conversion_table[0]')
v4l2.c:72: error: `V4L2_PIX_FMT_YUV422P' undeclared here (not in a function)
v4l2.c:72: error: initializer element is not constant
v4l2.c:72: error: (near initialization for `fmt_conversion_table[1].v4l2_fmt')
v4l2.c:73: error: initializer element is not constant
v4l2.c:73: error: (near initialization for `fmt_conversion_table[1]')
v4l2.c:76: error: `V4L2_PIX_FMT_YUYV' undeclared here (not in a function)
v4l2.c:76: error: initializer element is not constant
v4l2.c:76: error: (near initialization for `fmt_conversion_table[2].v4l2_fmt')
v4l2.c:77: error: initializer element is not constant
v4l2.c:77: error: (near initialization for `fmt_conversion_table[2]')
v4l2.c:80: error: `V4L2_PIX_FMT_UYVY' undeclared here (not in a function)
v4l2.c:80: error: initializer element is not constant
v4l2.c:80: error: (near initialization for `fmt_conversion_table[3].v4l2_fmt')
v4l2.c:81: error: initializer element is not constant
v4l2.c:81: error: (near initialization for `fmt_conversion_table[3]')
v4l2.c:84: error: `V4L2_PIX_FMT_YUV411P' undeclared here (not in a function)
v4l2.c:84: error: initializer element is not constant
v4l2.c:84: error: (near initialization for `fmt_conversion_table[4].v4l2_fmt')
v4l2.c:85: error: initializer element is not constant
v4l2.c:85: error: (near initialization for `fmt_conversion_table[4]')
v4l2.c:88: error: `V4L2_PIX_FMT_YUV410' undeclared here (not in a function)
v4l2.c:88: error: initializer element is not constant
v4l2.c:88: error: (near initialization for `fmt_conversion_table[5].v4l2_fmt')
v4l2.c:89: error: initializer element is not constant
v4l2.c:89: error: (near initialization for `fmt_conversion_table[5]')
v4l2.c:92: error: `V4L2_PIX_FMT_BGR24' undeclared here (not in a function)
v4l2.c:92: error: initializer element is not constant
v4l2.c:92: error: (near initialization for `fmt_conversion_table[6].v4l2_fmt')
v4l2.c:93: error: initializer element is not constant
v4l2.c:93: error: (near initialization for `fmt_conversion_table[6]')
v4l2.c:96: error: `V4L2_PIX_FMT_RGB24' undeclared here (not in a function)
v4l2.c:96: error: initializer element is not constant
v4l2.c:96: error: (near initialization for `fmt_conversion_table[7].v4l2_fmt')
v4l2.c:97: error: initializer element is not constant
v4l2.c:97: error: (near initialization for `fmt_conversion_table[7]')
v4l2.c:106: error: `V4L2_PIX_FMT_GREY' undeclared here (not in a function)
v4l2.c:106: error: initializer element is not constant
v4l2.c:106: error: (near initialization for `fmt_conversion_table[8].v4l2_fmt')
v4l2.c:107: error: initializer element is not constant
v4l2.c:107: error: (near initialization for `fmt_conversion_table[8]')
v4l2.c: In function `device_open':
v4l2.c:112: error: storage size of 'cap' isn't known
v4l2.c:124: error: `VIDIOC_QUERYCAP' undeclared (first use in this function)
v4l2.c:124: error: (Each undeclared identifier is reported only once
v4l2.c:124: error: for each function it appears in.)
v4l2.c:131: error: `V4L2_CAP_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:112: warning: unused variable `cap'
v4l2.c: In function `device_init':
v4l2.c:143: error: storage size of 'fmt' isn't known
v4l2.c:145: error: invalid application of `sizeof' to incomplete type `v4l2_format'
v4l2.c:146: error: `V4L2_BUF_TYPE_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:150: error: `V4L2_FIELD_INTERLACED' undeclared (first use in this function)
v4l2.c:151: error: `VIDIOC_S_FMT' undeclared (first use in this function)
v4l2.c:143: warning: unused variable `fmt'
v4l2.c: In function `first_field':
v4l2.c:157: error: `v4l2_std_id' undeclared (first use in this function)
v4l2.c:157: error: syntax error before "std"
v4l2.c:159: error: `VIDIOC_G_STD' undeclared (first use in this function)
v4l2.c:159: error: `std' undeclared (first use in this function)
v4l2.c:163: error: `V4L2_STD_NTSC' undeclared (first use in this function)
v4l2.c: In function `mmap_init':
v4l2.c:198: error: storage size of 'req' isn't known
v4l2.c:201: error: invalid application of `sizeof' to incomplete type `v4l2_requestbuffers'
v4l2.c:203: error: `V4L2_BUF_TYPE_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:204: error: `V4L2_MEMORY_MMAP' undeclared (first use in this function)
v4l2.c:205: error: `VIDIOC_REQBUFS' undeclared (first use in this function)
v4l2.c:237: error: storage size of 'buf' isn't known
v4l2.c:239: error: invalid application of `sizeof' to incomplete type `v4l2_buffer'
v4l2.c:243: error: `VIDIOC_QUERYBUF' undeclared (first use in this function)
v4l2.c:237: warning: unused variable `buf'
v4l2.c:198: warning: unused variable `req'
v4l2.c: In function `mmap_read_frame':
v4l2.c:275: error: storage size of 'buf' isn't known
v4l2.c:278: error: invalid application of `sizeof' to incomplete type `v4l2_buffer'
v4l2.c:279: error: `V4L2_BUF_TYPE_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:280: error: `V4L2_MEMORY_MMAP' undeclared (first use in this function)
v4l2.c:283: error: `VIDIOC_DQBUF' undeclared (first use in this function)
v4l2.c:296: error: `VIDIOC_QBUF' undeclared (first use in this function)
v4l2.c:275: warning: unused variable `buf'
v4l2.c: In function `mmap_start':
v4l2.c:313: error: storage size of 'type' isn't known
v4l2.c:317: error: storage size of 'buf' isn't known
v4l2.c:319: error: invalid application of `sizeof' to incomplete type `v4l2_buffer'
v4l2.c:320: error: `V4L2_BUF_TYPE_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:321: error: `V4L2_MEMORY_MMAP' undeclared (first use in this function)
v4l2.c:324: error: `VIDIOC_QBUF' undeclared (first use in this function)
v4l2.c:317: warning: unused variable `buf'
v4l2.c:333: error: `VIDIOC_STREAMON' undeclared (first use in this function)
v4l2.c:313: warning: unused variable `type'
v4l2.c: In function `mmap_close':
v4l2.c:345: error: storage size of 'type' isn't known
v4l2.c:348: error: `V4L2_BUF_TYPE_VIDEO_CAPTURE' undeclared (first use in this function)
v4l2.c:352: error: `VIDIOC_STREAMOFF' undeclared (first use in this function)
v4l2.c:345: warning: unused variable `type'
v4l2.c: In function `v4l2_read_header':
v4l2.c:439: error: `V4L2_CAP_STREAMING' undeclared (first use in this function)
make[1]: *** [v4l2.o] Error 1
make[1]: Leaving directory `/home/zax/main/ffmpeg/libavformat'
make: *** [lib] Error 2
my kernel has been compiled with support for v4l support, and yet I'm still getting these errors... even by "cheating" past the errors by:
Code:
make -i
I still can't build a working ffmpeg program (this carries over, disallowing me from building mplayer due to the libav libraries)

Anyone know what's going on?

**Also, if I use the configure option --disable-v4l, I still get this error message:
Code:
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/zax/main/ffmpeg/libavformat'
gcc -Wl,--warn-common -rdynamic -g -o ffmpeg_g ffmpeg.o cmdutils.o -L./libavformat -lavformat -L./libavcodec -lavcodec -L./libavutil -lavutil -lm -lmp3lame -logg -lvorbis -lvorbisenc -lfaad -lfaac -lxvidcore -lx264 -ldts -ldts -lz -ldl -lpthread
./libavcodec/libavcodec.so: undefined reference to `XSync'
./libavcodec/libavcodec.so: undefined reference to `XDrawPoint'
./libavcodec/libavcodec.so: undefined reference to `XMapWindow'
./libavcodec/libavcodec.so: undefined reference to `XCreateImage'
./libavcodec/libavcodec.so: undefined reference to `XSetForeground'
./libavcodec/libavcodec.so: undefined reference to `XAllocNamedColor'
./libavcodec/libavcodec.so: undefined reference to `XResizeWindow'
./libavcodec/libavcodec.so: undefined reference to `XAllocSizeHints'
./libavformat/libavformat.so: undefined reference to `v4l2_init'
./libavcodec/libavcodec.so: undefined reference to `XFree'
./libavcodec/libavcodec.so: undefined reference to `XCreateColormap'
./libavcodec/libavcodec.so: undefined reference to `XDrawLine'
./libavcodec/libavcodec.so: undefined reference to `XCreateWindow'
./libavcodec/libavcodec.so: undefined reference to `XNextEvent'
./libavcodec/libavcodec.so: undefined reference to `XDrawRectangle'
./libavcodec/libavcodec.so: undefined reference to `XSelectInput'
./libavcodec/libavcodec.so: undefined reference to `XSetStandardProperties'
./libavcodec/libavcodec.so: undefined reference to `XPutImage'
./libavcodec/libavcodec.so: undefined reference to `XOpenDisplay'
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1

Last edited by mrchaos; 02-06-2006 at 05:27 PM.
 
Old 02-06-2006, 10:16 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
we need gcc version and ffmpeg version
 
Old 02-07-2006, 08:33 AM   #3
mrchaos
Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware current, Fedora Core 5, SuSE 10.1 OSS
Posts: 298

Original Poster
Rep: Reputation: 30
my apologies. I guess I didn't post the versions:

ffmpeg is being built via daily CVS repository, so it is the version from 2/7/2006

gcc is version 3.4.5, which I just built yesterday (includes java gcc and g++)
 
Old 02-16-2006, 05:23 PM   #4
mijanek
LQ Newbie
 
Registered: Feb 2006
Posts: 1

Rep: Reputation: 0
Cool errer in Include files...?

Hi I got the same problem,

my Kernel is 2.6.8 and i am using gcc (GCC) 3.4.1 (Mandrakelinux 10.1 3.4.1-4mdk)


I found out that in the include file linux\videodev2.h are some exlusions only to compile for kernel
(
#ifdef __KERNEL__
struct v4l2_buffer
{
etc..
)

so I commented out some of these #ifdef __KERNEL__ (and #endif) and it compiles now fine.


Last edited by mijanek; 02-16-2006 at 05:25 PM.
 
Old 02-17-2006, 01:13 PM   #5
mrchaos
Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware current, Fedora Core 5, SuSE 10.1 OSS
Posts: 298

Original Poster
Rep: Reputation: 30
actually, the ifdef_KERNEL lines are already commented out for my kernel...

I think it's a problem with GCC if anything... as of late I've had a hard time compiling certain programs (especially if they rely heavily on GTK+), but I'm still working on it.


There is definitely something wrong with my compiler that I am unaware of... I tried updating my glibc, but got an "undefined resource" error as I always do.

Last edited by mrchaos; 02-17-2006 at 02:34 PM.
 
Old 02-18-2006, 02:29 PM   #6
joslar
LQ Newbie
 
Registered: Feb 2006
Location: Espaņa
Distribution: Mandriva
Posts: 8

Rep: Reputation: 0
Code:
gcc -Wl,--warn-common -rdynamic -g -o ffmpeg_g ffmpeg.o cmdutils.o -L./libavformat -lavformat -L./libavcodec -lavcodec -L./libavutil -lavutil -lm -lvorbis -lvorbisenc -lmp3lame -logg -lx264 -lz -llzo -ldl -lpthread
./libavcodec/libavcodec.so: undefined reference to `XSync'
./libavcodec/libavcodec.so: undefined reference to `XDrawPoint'
./libavcodec/libavcodec.so: undefined reference to `XMapWindow'
./libavcodec/libavcodec.so: undefined reference to `XCreateImage'
./libavcodec/libavcodec.so: undefined reference to `XSetForeground'
./libavcodec/libavcodec.so: undefined reference to `XAllocNamedColor'
./libavcodec/libavcodec.so: undefined reference to `XResizeWindow'
./libavcodec/libavcodec.so: undefined reference to `XAllocSizeHints'
./libavcodec/libavcodec.so: undefined reference to `XFree'
./libavcodec/libavcodec.so: undefined reference to `XCreateColormap'
./libavcodec/libavcodec.so: undefined reference to `XDrawLine'
./libavcodec/libavcodec.so: undefined reference to `XCreateWindow'
./libavcodec/libavcodec.so: undefined reference to `XNextEvent'
./libavcodec/libavcodec.so: undefined reference to `XDrawRectangle'
./libavcodec/libavcodec.so: undefined reference to `XSelectInput'
./libavcodec/libavcodec.so: undefined reference to `XSetStandardProperties'
./libavcodec/libavcodec.so: undefined reference to `XPutImage'
./libavcodec/libavcodec.so: undefined reference to `XOpenDisplay'
collect2: ld devolviķ el estado de salida 1
make: *** [ffmpeg_g] Error 1
It is a problem of ffmpeg and Xorg, my Xorg's version is 7.0 and ffmpeg-CVS-18-2-2006
At the moment it seems that there is no solution to the problem
 
Old 02-18-2006, 09:55 PM   #7
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
OK this last thing and i realize also posted by OP is a linking error
nothing more than a bad Makefile or you could look at it as a bad gcc command
if you go to the directory the compiler was in when the link failed you can fix just copy past the gcc command back on the command line and add in xlib
something like this (not tested and you will have to play with it)
position is important so t might have to go further to the right -- i just put it to the right of the av stuff since that was the failure.
or you can go to the Makefile and alter it and add this stuff into a variable
try something like somewhere after the av stuff is added in.
EXTRALIBS+=-L/usr/X11R6/lib -lX11
Code:
gcc -Wl,--warn-common -rdynamic -g -o ffmpeg_g ffmpeg.o cmdutils.o -L./libavformat -lavformat -L./libavcodec -lavcodec -L./libavutil -lavutil -L/usr/X11R6/lib -lX11 -lm -lvorbis -lvorbisenc -lmp3lame -logg -lx264 -lz -llzo -ldl -lpthread
you can find missing objects like this
Code:
(10:51pm:02/18/06)
(gary) /usr/X11R6/lib  $ objdump -t libX11.so | grep XSync     
00031c90 l     F .text  0000002b              _XSyncFunction
00031b90 g     F .text  000000fc              XSync
00031cc0 g     F .text  0000009f              XSynchronize
(10:51pm:02/18/06)
(gary) /usr/X11R6/lib  $ objdump -t libX11.so | grep XDrawPoint
00017a00 g     F .text  00000180              XDrawPoint
00017b80 g     F .text  000003cb              XDrawPoints
might be more x libs we need ? but you get the picture

Last edited by foo_bar_foo; 02-18-2006 at 09:58 PM.
 
Old 02-19-2006, 11:48 AM   #8
joslar
LQ Newbie
 
Registered: Feb 2006
Location: Espaņa
Distribution: Mandriva
Posts: 8

Rep: Reputation: 0
THANK YOU!, though I have done it otherwise, editing the config.mak and adding the following thing in LDFLAGS =
Code:
 LDFLAGS=-Wl,--warn-common
Code:
 LDFLAGS=-Wl,--warn-common -L/usr/X11R6/lib -lX11
 
Old 02-20-2006, 01:28 PM   #9
mrchaos
Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware current, Fedora Core 5, SuSE 10.1 OSS
Posts: 298

Original Poster
Rep: Reputation: 30



(that's all I really have to say... THANK YOU SO MUCH!)
 
Old 09-30-2006, 07:38 AM   #10
Musikolo
Member
 
Registered: Jul 2003
Distribution: Yoper 2.91 beta (kernel 2.6.15)
Posts: 114

Rep: Reputation: 15
Thanks so much too! I had the same issue too. However I've fixed it in cleaner way. Just add this when you issue the 'configure' command:


--extra-ldflags='-L/usr/X11R6/lib -lX11'


I hope this helps someone else!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Polanski Linux - Laptop and Netbook 5 01-11-2006 07:01 PM
ffmpeg srpm build error texi2html dtra Linux - Software 0 10-21-2005 12:39 AM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 03:35 PM
Suse 9, RH9 wont install properly. Mandrake 9 wont boot properly? Help. l2ich84 Linux - Newbie 1 01-31-2004 11:02 AM
Kazaa lite 2.0 build 2 and 2.02 build 5 walterw Linux - General 1 02-04-2003 04:12 PM


All times are GMT -5. The time now is 11:39 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration