Problems compiling 1.24 on Fedora 9

Forum for questions and support relating to the 1.24.x releases only.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Problems compiling 1.24 on Fedora 9

Post by nombrandue »

I have spent the better part of the morning hand feeding my dev system the proper pre-reqs for the new zoneminder, since I want to have a good look at what is in the pipe. After I get the configure to run smoothly with no errors I get this error when doing a make, or make check, and it isn't able to find some of the library files, even when I move them to a different location that the config is looking for (read it as another fix for an older version tried it and the second error code from make is what happened):

Code: Select all

Thu Jan 29-11:48:40-root@eiji.tsukinokage.net:ZoneMinder-1.24.0> make check
Making check in src
make[1]: Entering directory `/root/ZoneMinder-1.24.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr//include -I/usr/lib//include -Wall -Wno-sign-compare -fno-inline -I/usr/lib//include  -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_mpeg.h:23,
                 from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:28,
                 from zmc.cpp:28:
zm_ffmpeg.h:33:2: error: #error "No location for avutils.h found"
zm_ffmpeg.h:40:2: error: #error "No location for avcodec.h found"
zm_ffmpeg.h:47:2: error: #error "No location for avformat.h found"
zm_ffmpeg.h:55:2: error: #error "No location for swscale.h found"
In file included from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:28,
                 from zmc.cpp:28:
zm_mpeg.h:43: error: use of enum ‘PixelFormat’ without previous declaration
zm_mpeg.h:44: error: ISO C++ forbids declaration of ‘AVOutputFormat’ with no type
zm_mpeg.h:44: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:45: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_mpeg.h:45: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:46: error: ISO C++ forbids declaration of ‘AVStream’ with no type
zm_mpeg.h:46: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:47: error: ISO C++ forbids declaration of ‘AVFrame’ with no type
zm_mpeg.h:47: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:48: error: ISO C++ forbids declaration of ‘AVFrame’ with no type
zm_mpeg.h:48: error: expected ‘;’ before ‘*’ token
make[1]: *** [zmc.o] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.0/src'
make: *** [check-recursive] Error 1

My compiler items are:
gcc-4.3.0-8.i386
compat-gcc-34-g77-3.4.6-9.i386
gcc-c++-4.3.0-8.i386
compat-gcc-34-3.4.6-9.i386
compat-gcc-34-c++-3.4.6-9.i386



I have moved a large portion of my ffmpeg libraries to one folder, and eliminated most of the errors.


Code: Select all

make  all-recursive
make[1]: Entering directory `/root/ZoneMinder-1.24.0'
Making all in src
make[2]: Entering directory `/root/ZoneMinder-1.24.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr//include -I/usr/include//include -Wall -Wno-sign-compare -fno-inline -I/usr/include//include  -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_stream.h:28,
                 from zm_event.h:40,
                 from zm_zone.h:28,
                 from zm_monitor.h:29,
                 from zmc.cpp:29:
zm_mpeg.h:44: error: ISO C++ forbids declaration of ‘AVOutputFormat’ with no type
zm_mpeg.h:44: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:45: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_mpeg.h:45: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:46: error: ISO C++ forbids declaration of ‘AVStream’ with no type
zm_mpeg.h:46: error: expected ‘;’ before ‘*’ token
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/root/ZoneMinder-1.24.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.0'
make: *** [all] Error 2
All the files in that directory are:

Code: Select all

Thu Jan 29-13:24:55-root@eiji.tsukinokage.net:~> cd /usr/include/ffmpeg
Thu Jan 29-13:25:03-root@eiji.tsukinokage.net:ffmpeg> ls
libavcodec  libavdevice  libavfilter  libavformat  libavutil  libpostproc  libswscale
Thu Jan 29-13:25:03-root@eiji.tsukinokage.net:ffmpeg> cp */* ./
Thu Jan 29-13:25:09-root@eiji.tsukinokage.net:ffmpeg> ls
adler32.h   avformat.h  base64.h  intfloat_readwrite.h  libavformat  log.h          mem.h          rational.h   sha1.h
avcodec.h   avio.h      common.h  libavcodec            libavutil    lzo.h          opt.h          rgb2rgb.h    swscale.h
avdevice.h  avstring.h  crc.h     libavdevice           libpostproc  mathematics.h  postprocess.h  rtspcodes.h
avfilter.h  avutil.h    fifo.h    libavfilter           libswscale   md5.h          random.h       rtsp.h

nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

I need to note a correction, the last code snippet in my first post was after attempting a quick fix to locate the correct header file, but it also failed. I guess that is what happens when you don't know C++ well. Here is the original unmodified re-run with the correct paramenters

Code: Select all

Thu Jan 29-13:31:39-root@eiji.tsukinokage.net:ZoneMinder-1.24.0> make
make  all-recursive
make[1]: Entering directory `/root/ZoneMinder-1.24.0'
Making all in src
make[2]: Entering directory `/root/ZoneMinder-1.24.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr//include -I/usr/include//include -Wall -Wno-sign-compare -fno-inline -I/usr/include//include  -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_mpeg.h:23,
                 from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:28,
                 from zmc.cpp:28:
zm_ffmpeg.h:47:2: error: #error "No location for avformat.h found"
In file included from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:28,
                 from zmc.cpp:28:
zm_mpeg.h:44: error: ISO C++ forbids declaration of ‘AVOutputFormat’ with no type
zm_mpeg.h:44: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:45: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_mpeg.h:45: error: expected ‘;’ before ‘*’ token
zm_mpeg.h:46: error: ISO C++ forbids declaration of ‘AVStream’ with no type
zm_mpeg.h:46: error: expected ‘;’ before ‘*’ token
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/root/ZoneMinder-1.24.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.0'
make: *** [all] Error 2
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

What version of ffmpeg are you using, it needs to be from svn with in the last 5 months or so.... unless they changed things again recently.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

The version I have installed are (RPM info first, ffmpeg -V output second)


Code: Select all

Thu Jan 29-20:43:04-root@eiji.tsukinokage.net:~> rpmquery -a | grep ffmpeg
ffmpeg-compat-0.4.9-0.48.20080225.fc9.i386
ffmpeg-libs-0.4.9-0.48.20080908.fc9.i386
ffmpeg-compat-devel-0.4.9-0.48.20080225.fc9.i386
ffmpeg-0.4.9-0.48.20080908.fc9.i386
ffmpeg-devel-0.4.9-0.48.20080908.fc9.i386
Thu Jan 29-20:43:20-root@eiji.tsukinokage.net:~> ffmpeg -V
FFmpeg version SVN-r15261, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --arch=i386 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -fasm -std=c99 -fno-math-errno --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-swscale --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-optimizations --disable-stripping
  libavutil     49.10. 0 / 49.10. 0
  libavcodec    51.71. 0 / 51.71. 0
  libavformat   52.22. 1 / 52.22. 1
  libavdevice   52. 1. 0 / 52. 1. 0
  libavfilter    0. 1. 0 /  0. 1. 0
  libswscale     0. 6. 1 /  0. 6. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Sep 17 2008 20:49:54, gcc: 4.3.0 20080428 (Red Hat 4.3.0-8)
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

This version is a few months too old. You need to update ffmpeg to a newer version.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

Ok, I will get that updated and looked at. Is there a specific version that is the 'oldest' that will work on this?
nuck
Posts: 148
Joined: Tue Nov 11, 2008 1:43 am
Location: Canada

Post by nuck »

nombrandue wrote:Ok, I will get that updated and looked at. Is there a specific version that is the 'oldest' that will work on this?
Can't help you out with your specific question but I will suggest that you keep in mind that a few months back the ffmpeg developers moved the locations of the header files (used to be spread over several directories and now incorporated into /usr/include/ffmpeg), so watch out that you don't get snake bit by old headers you don't realize are there.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

ok, so I ran a git on the svn to get the latest ffmpeg (after erasing the rpm, and making sure it was gone) I compiled and installed the SVN version of ffmpeg and now I am getting:

Code: Select all

make  all-recursive
make[1]: Entering directory `/root/ZoneMinder-1.24.0'
Making all in src
make[2]: Entering directory `/root/ZoneMinder-1.24.0/src'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr//include -I/usr/include/ffmpeg-compat//include -Wall -Wno-sign-compare -fno-inline -I/usr/include/ffmpeg-compat//include  -frepo -g -O2 -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zm_mpeg.h:23,
                 from zm_stream.h:27,
                 from zm_event.h:39,
                 from zm_zone.h:27,
                 from zm_monitor.h:28,
                 from zmc.cpp:28:
zm_ffmpeg.h:55:2: error: #error "No location for swscale.h found"
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/root/ZoneMinder-1.24.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.0'
make: *** [all] Error 2
I am working on getting all the headers into the same directory currently to test to see if this fixes the silly error (at least it is a different error now) and in doing that I got it to move farther with the compiling proccess.

Now I am getting:


Code: Select all

/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../../include/c++/4.3.0/bits/stl_set.h:93: undefined reference to `std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::~_Rb_tree()'
zm_thread.o: In function `neverCalled()':
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:22: undefined reference to `ThreadData<bool>::ThreadData()'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:23: undefined reference to `ThreadData<bool>::setValue(bool)'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:24: undefined reference to `ThreadData<bool>::getUpdatedValue() const'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:25: undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:26: undefined reference to `ThreadData<bool>::getUpdatedValue(double) const'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:27: undefined reference to `ThreadData<bool>::updateValueSignal(bool)'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:28: undefined reference to `ThreadData<bool>::updateValueBroadcast(bool)'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:30: undefined reference to `ThreadData<int>::ThreadData()'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:31: undefined reference to `ThreadData<int>::getValue() const'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:32: undefined reference to `ThreadData<int>::setValue(int)'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:33: undefined reference to `ThreadData<int>::getUpdatedValue(int) const'
/root/ZoneMinder-1.24.0/src/zm_threaddata.cpp:34: undefined reference to `ThreadData<int>::updateValueBroadcast(int)'
zm_timer.o: In function `Timer::TimerThread::run()':
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:82: undefined reference to `ThreadData<bool>::setValue(bool)'
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:84: undefined reference to `ThreadData<bool>::getUpdatedValue(int) const'
zm_timer.o: In function `Timer::TimerThread::reset()':
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:65: undefined reference to `ThreadData<bool>::updateValueSignal(bool)'
zm_timer.o: In function `Timer::TimerThread::cancel()':
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:53: undefined reference to `ThreadData<bool>::updateValueSignal(bool)'
zm_timer.o: In function `TimerThread':
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:32: undefined reference to `ThreadData<bool>::ThreadData(bool)'
/root/ZoneMinder-1.24.0/src/zm_timer.cpp:32: undefined reference to `ThreadData<bool>::ThreadData(bool)'
zm_utils.o: In function `startsWith(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/root/ZoneMinder-1.24.0/src/zm_utils.cpp:56: undefined reference to `__gnu_cxx::__enable_if<std::__is_char<char>::__value, bool>::__type std::operator==<char>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
zm_utils.o: In function `split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/root/ZoneMinder-1.24.0/src/zm_utils.cpp:61: undefined reference to `std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::vector()'
/root/ZoneMinder-1.24.0/src/zm_utils.cpp:71: undefined reference to `std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::push_back(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/root/ZoneMinder-1.24.0/src/zm_utils.cpp:78: undefined reference to `std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~vector()'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/root/ZoneMinder-1.24.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/ZoneMinder-1.24.0'
make: *** [all] Error 2
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Did you remember to rerun configure for ZM?
Phil
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

Yes, I cleaned and re-ran the config a few times, even removed the source directory and unpacked the RC tar file again (ZoneMinder-1.24.0-rc1-2734.tar.gz) and re-ran it a few times. I also tested a few items, it seems that it is dying on linking, when I run it manually and add in the -c flag in the g++ line, everything runs smooth, it is when I allow it to link is when it tanks on me. The command I am reffering to is:

Code: Select all

g++ -frepo -g -O2  -L/usr/include/ffmpeg//lib -L/usr//lib/mysql   -o zmc zmc.o zm_box.o zm_buffer.o zm_camera.o zm_comms.o zm_config.o zm_coord.o zm.o zm_db.o zm_debug.o zm_event.o zm_exception.o zm_file_camera.o zm_ffmpeg_camera.o zm_image.o zm_jpeg.o zm_local_camera.o zm_monitor.o zm_ffmpeg.o zm_mpeg.o zm_poly.o zm_regexp.o zm_remote_camera.o zm_remote_camera_http.o zm_remote_camera_rtsp.o zm_rtp.o zm_rtp_ctrl.o zm_rtp_data.o zm_rtp_source.o zm_rtsp.o zm_signal.o zm_stream.o zm_thread.o zm_time.o zm_timer.o zm_user.o zm_utils.o zm_zone.o  -lbz2 -lswscale -lavformat -lavcodec -lavutil -lgnutls-openssl -lmysqlclient -lpthread -ldl -lz -ljpeg


As a side note, should I be on Fedora 9, or 10, or doesn't that matter? I plan on moving to CentOS when I get fedora built and played with for ZM.
nuck
Posts: 148
Joined: Tue Nov 11, 2008 1:43 am
Location: Canada

Post by nuck »

nombrandue wrote:As a side note, should I be on Fedora 9, or 10, or doesn't that matter? I plan on moving to CentOS when I get fedora built and played with for ZM.
Just a thought, but why not just make the move to CentOS and go from there in the first place? All distro's and release versions have their own little "quirks" and chances are that whatever you do to get ZM working with Fedora 9 isn't going to apply if/when you run into snags with CentOS.

As for your previous post where you'd mentioned manually moving ffmpeg header files around to get a build to work. Don't do it. There should be no need to get into that sort of stuff if your gnu build tools are up to date and you are using a CVS copy of ffmpeg. Nor should you have to get into playing with compiler switches unless you are trying to optimize performance.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

Nuck, That was my logic, I set up, tested, and got running a CentOS5 1.23.3 version of Zoneminder as a test (To make sure I knew, and had all of the little things that need to build a stable ZM) and am planning on running a 1.24 build here in the next 24 hours, hopefully with the success I had just yesterday. I seem to have a lot of quirks that kick me in the rear with Fedora in that light. (I also had problems where motion wasn't being detected on Fedora and that has gone away in CentOs, which is what I figured would happen)


The moving of the header files was because the RPM version didn't place the files in a flat all headers in one directory, and I read to put them all in one directory. When I found out using the CVS for FFMPEG was reccomended, I did that path instead, and solved that portion of my issues. The compiler switches was just checking to see where it was breaking. Sadly I don't know C++ that well, so I guess it was a bit of a futile effort.


Thanks for the adice and if I do have issues with the re-attempt on 1.24 I will post those issues now that I am off of Fedora on that server.
nombrandue
Posts: 38
Joined: Wed Mar 28, 2007 12:30 am
Location: Omaha Nebraska

Post by nombrandue »

I have made progress getting this to compile (Stuckon V4L errors, and looking for the items I need to get the system ready, and have the missing headers)

Problems I have noticed that have gotten me confused with compiling this is when I specify path's to libraries, in this case, ffmpeg, it seems that the make file includes additional path, as an example, most programs I have compiled, if I throw the switch to the configure program:

--with-ffmpeg=/usr/local/include/ffmpeg

it will use that exact path. When validating the output from this and running a make on Zoneminder I get a path that isn't /usr/local/include/ffmpeg, but /usr/local/include/ffmpeg/include. If I modify that to compensate for the automatically included /include I get the compiler using almost the right path of /usr/local/include.

My work around to see if I could move forward with this was to create /tmp/ffmpeg/include, copy all the files from /usr/local/include/ffmpeg to /tmp/ffmpeg/include and it worked. Save for my lacking of V4L headers on the system (simple fix after I get it all together on the system, yet another package I missed/failed to install)

as a quick example of my configure problem:

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr//include -I/tmp/ffmpeg//include -Wall -Wno-sign-compare -fno-inline -I/tmp/ffmpeg//include  -frepo -g -O2 -MT zm_local_camera.o -MD -MP -MF .deps/zm_local_camera.Tpo -c -o zm_local_camera.o zm_local_camera.cpp
note where in that line it is a // is where the addition to the path occurs.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I think /usr/local/include is typcially on the include path anyway so you shouldn't need any special config for that location. The --with-ffmpeg path is for when you want to steer ZM away completely from any system installed ffmpeg files primarily as you have done.

A lot of ffmpeg problems happen because a distro version of ffmpeg will put the headers and libraries in one place and the svn version will put them somewhere else and then you end up with a horrendous chimera that has bits of both.
Phil
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

Please Phil, can you tell us what ffmpeg svn version you use? And what switches? (--ennable-libfaac, etc)

I have tried with rpms, compiling, etc without success. I have all the problems say at this and other posts in the forum.

Thank you
Locked