Page 1 of 1

Make error

Posted: Sun Sep 28, 2008 4:53 pm
by craver84
Hi, I've got an error when I start make:

Code: Select all

......
......
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -I/usr/include -Wall -Wno-sign-compare -fno-inline  -frepo -g -O2 -MT zm_monitor.o -MD -MP -MF .deps/zm_monitor.Tpo -c -o zm_monitor.o zm_monitor.cpp
In file included from zm_rtsp.h:30,
                 from zm_remote_camera_rtsp.h:27,
                 from zm_monitor.cpp:33:
zm_sdp.h:9:2: error: #error "No location for rtsp.h found"
In file included from zm_rtsp.h:30,
                 from zm_remote_camera_rtsp.h:27,
                 from zm_monitor.cpp:33:
zm_sdp.h:24: error: ‘AVCodecContext’ was not declared in this scope
zm_sdp.h:24: error: ‘codec’ was not declared in this scope
zm_sdp.h:24: error: expected primary-expression before ‘int’
zm_sdp.h:24: error: initializer expression list treated as compound expression
zm_sdp.h:27: error: ‘AVCodecContext’ was not declared in this scope
zm_sdp.h:27: error: ‘codec’ was not declared in this scope
zm_sdp.h:31: error: ‘AVFormatContext’ was not declared in this scope
zm_sdp.h:31: error: ‘s1’ was not declared in this scope
zm_sdp.h:31: error: ‘AVStream’ was not declared in this scope
zm_sdp.h:31: error: ‘st’ was not declared in this scope
zm_sdp.h:31: error: ‘URLContext’ was not declared in this scope
zm_sdp.h:31: error: ‘rtpc’ was not declared in this scope
zm_sdp.h:31: error: expected primary-expression before ‘int’
zm_sdp.h:31: error: expected primary-expression before ‘*’ token
zm_sdp.h:31: error: ‘rtp_payload_data’ was not declared in this scope
zm_sdp.h:31: error: initializer expression list treated as compound expression
zm_sdp.h:32: error: ‘AVPacket’ has not been declared
zm_sdp.h:36: error: ‘URLContext’ was not declared in this scope
zm_sdp.h:36: error: ‘h’ was not declared in this scope
zm_sdp.h:37: error: ‘URLContext’ was not declared in this scope
zm_sdp.h:37: error: ‘h’ was not declared in this scope
zm_sdp.h:37: error: expected primary-expression before ‘const’
zm_sdp.h:37: error: initializer expression list treated as compound expression
zm_sdp.h:38: error: variable or field ‘rtp_get_file_handles’ declared void
zm_sdp.h:38: error: ‘URLContext’ was not declared in this scope
zm_sdp.h:38: error: ‘h’ was not declared in this scope
zm_sdp.h:38: error: expected primary-expression before ‘int’
zm_sdp.h:38: error: expected primary-expression before ‘int’
zm_sdp.h:114: error: ‘AVPacket’ has not been declared
zm_sdp.h:122: error: use of enum ‘CodecType’ without previous declaration
zm_sdp.h:123: error: use of enum ‘CodecID’ without previous declaration
zm_sdp.h:126: error: ‘AVStream’ has not been declared
zm_sdp.h:138: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_sdp.h:138: error: expected ‘;’ before ‘*’ token
zm_sdp.h:139: error: ISO C++ forbids declaration of ‘AVStream’ with no type
zm_sdp.h:139: error: expected ‘;’ before ‘*’ token
zm_sdp.h:151: error: ISO C++ forbids declaration of ‘URLContext’ with no type
zm_sdp.h:151: error: expected ‘;’ before ‘*’ token
zm_sdp.h:183: error: variable or field ‘ff_rtp_send_data’ declared void
zm_sdp.h:183: error: ‘AVFormatContext’ was not declared in this scope
zm_sdp.h:183: error: ‘s1’ was not declared in this scope
zm_sdp.h:183: error: expected primary-expression before ‘const’
zm_sdp.h:183: error: expected primary-expression before ‘int’
zm_sdp.h:183: error: expected primary-expression before ‘int’
zm_sdp.h:185: error: use of enum ‘CodecID’ without previous declaration
zm_sdp.h:185: error: use of enum ‘CodecType’ without previous declaration
zm_sdp.h:185: error: invalid type in declaration before ‘;’ token
zm_sdp.h:206: error: ISO C++ forbids declaration of ‘URLContext’ with no type
zm_sdp.h:206: error: expected ‘;’ before ‘*’ token
zm_sdp.h:217: error: use of enum ‘RTSPProtocol’ without previous declaration
zm_sdp.h:226: error: ‘AVFormatContext’ was not declared in this scope
zm_sdp.h:226: error: ‘s’ was not declared in this scope
zm_sdp.h:226: error: expected primary-expression before ‘const’
zm_sdp.h:226: error: initializer expression list treated as compound expression
In file included from zm_remote_camera_rtsp.h:27,
                 from zm_monitor.cpp:33:
zm_rtsp.h:71: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_rtsp.h:71: error: expected ‘;’ before ‘*’ token
zm_rtsp.h:110: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_rtsp.h:110: error: expected ‘;’ before ‘*’ token
zm_rtsp.h:115: error: expected `;' before ‘bool’
In file included from zm_monitor.cpp:33:
zm_remote_camera_rtsp.h:51: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type
zm_remote_camera_rtsp.h:51: error: expected ‘;’ before ‘*’ token
zm_remote_camera_rtsp.h:52: error: ISO C++ forbids declaration of ‘AVCodec’ with no type
zm_remote_camera_rtsp.h:52: error: expected ‘;’ before ‘*’ token
zm_remote_camera_rtsp.h:53: error: ISO C++ forbids declaration of ‘AVCodecContext’ with no type
zm_remote_camera_rtsp.h:53: error: expected ‘;’ before ‘*’ token
zm_remote_camera_rtsp.h:54: error: ISO C++ forbids declaration of ‘AVFrame’ with no type
zm_remote_camera_rtsp.h:54: error: expected ‘;’ before ‘*’ token
make[2]: *** [zm_monitor.o] Error 1
make[2]: Leaving directory `/home/paolo/ZoneMinder-1.24.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/paolo/ZoneMinder-1.24.0'
make: *** [all] Error 2
paolo@VirtuaLinux:~/ZoneMinder-1.24.0$ 
how can I solve it?
thanks

Posted: Mon Sep 29, 2008 11:35 am
by zoneminder
What was your configure command and what was the output?

Posted: Mon Sep 29, 2008 12:49 pm
by craver84
Hi, I'm tring to install it on a dedicated PC with CentOS....
I'm following this guide:
http://www.zoneminder.com/wiki/index.php/CentOS

at first I had a problem installing ffmpeg. Looking around the forum I solved in this way:

Code: Select all

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg/ 
./configure
make 
make install 
make install-libs

Code: Select all

cd /root/
tar -zxvf ZoneMinder-1.24.0.tar.gz
cd ZoneMinder-1.24.0
./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin
make     <-------- errors
I think the error is due to ffmpeg...
I tried a different way to install ffmpeg like

yum install ffmpeg but it says:
Package ffmpeg - 0.4.9-0.9.29970530.el5.rf.i386 is already installed

the zm make error is:
zm_mpeg.cpp:325: error: 'img_convert' wan not declared in this scope

how can I solve it? Thanks!

Posted: Mon Sep 29, 2008 12:56 pm
by richw
It sound's like you have installed ffmpeg with yum at some point and you have complied a new version and installed it over the top.

I'd goto the ffmpeg directory you downloaded it to, do a "make uninstall" & "make uninstall-libs", do 'yum remove ffmpeg' and then look in the "tips and tricks" forum for the ffmpeg files and make sure it's been completely removed.

Once that is done, I'd reinstall ffmpeg you downloaded ('make install' &
'make install-libs') and then try to make ZM again.

Posted: Mon Sep 29, 2008 1:05 pm
by zoneminder
Also for 1.24.x you need to have swscaler enabled in ffmpeg so you will need to add --enable-swscale --enable-gpl to the configure line for ffmpeg.

Posted: Tue Sep 30, 2008 8:06 pm
by craver84
I solved but I still have problems... I'm sorry but I'm a beginner with linux...

The web interface says that I need to install mootools, but I don't know how and where. (I haven't a /usr/share/zoneminder directory)

I think I should wait untill a stable version is released.

I also hope there will be an .rpm or .deb and the CentOS guide will be update (I followed it and I had the problems I wrote...)

Thanks to all the developers for their hard work!

Posted: Tue Sep 30, 2008 8:43 pm
by zoneminder
This is a third party library but I will be doing a drop in the next day or two with it included in ZM so it will save one job at least.

Posted: Wed Oct 01, 2008 3:55 pm
by monex
Hi,

I have a similar problem but I have disabled ffmpeg because I wanted to build a version without:

Code: Select all

./configure --with-mysql=/usr/include/mysql --with-webdir=/srv/www/htdocs/zm --with-cgidir=/srv/www/cgi-bin --sysconfdir=/etc --bindir=/usr/bin --without-ffmpeg --without-lame --with-libarch=lib64 --with-webuser=wwwrun --with-webgroup=www --enable-crashtrace=yes --enable-debug=yes ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=... ZM_DB_PASS=...
I think for some users it is essential that ffmpeg is not mandatory requirement.

Posted: Sat May 30, 2009 8:28 pm
by Syrinx
I'm having a problem similar to others in this thread. I'm installing ZM from code. Here's the error during the build step:

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/src/mysql/include -I/usr/lib/include -Wall -Wno-sign-compare -fno-inline -I/usr/lib/include  -frepo -O2 -I/usr/src/jpeg -MT zm_mpeg.o -MD -MP -MF .deps/zm_mpeg.Tpo -c -o zm_mpeg.o zm_mpeg.cpp
zm_mpeg.cpp: In member function ‘double VideoStream::EncodeFrame(uint8_t*, int, bool, unsigned int)’:
zm_mpeg.cpp:325: error: ‘img_convert’ was not declared in this scope
make[1]: *** [zm_mpeg.o] Error 1
make[1]: Leaving directory `/usr/src/ZoneMinder-1.24.1/src'
make: *** [install-recursive] Error 1
I'm guessing it may be a problem/conflict with ffmpeg. I've got Ubuntu's (Jaunty) bundled ffmpeg version installed. Synaptic Package Manager says this ffmpeg version is 3:0.svn20090303-1ubuntu6.

I think the subversion mentioned in the version string (svn) is ffmpeg's subversion server, which would make the ffmpeg version very recent (March 3, 2009).

My configure step indicated no problems.

Any ideas? Thanks.

Posted: Sun May 31, 2009 8:58 am
by Syrinx
I think I figured it out. If you look at the offending code, it has an ifdef:

Code: Select all

#ifdef HAVE_LIBSWSCALE
        if ( !img_convert_ctx )
        {
            img_convert_ctx = sws_getContext( c->width, c->height, pf, c->width, c->height, c->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL );
            if ( !img_convert_ctx )
                Fatal( "Unable to initialise image scaling context" );
        }
        sws_scale( img_convert_ctx, tmp_opicture->data, tmp_opicture->linesize, 0, c->height, opicture->data, opicture->linesize );
#else // HAVE_LIBSWSCALE
                img_convert( (AVPicture *)opicture, c->pix_fmt, (AVPicture *)tmp_opicture, pf, c->width, c->height );
#endif // HAVE_LIBSWSCALE
I installed the libswscale package, and now it compiles/links/installs just fine.

However, it seems like a bug if the compile unconditionally fails when an ifdef condition is not met. Especially a silent condition. Might as well just remove the ifdef and loudly force everyone to install the libswscale package.

Should I file a bug or is there a good reason for the ifdef?

Remember to re-run "configure" after installing &q

Posted: Sat Sep 11, 2010 4:17 pm
by rrs
In my case I installed the required components one-by-one as I found them missing due to compile errors during "make" attempts. But I had not gone back and re-run configure, to update the #define definitions in the C++ files so the new components will be used in the build process, hence the undefined symbol compile error. Once I re-ran "configure" the compile error was gone.

So, if you add or remove Linux components used by the build, remember to re-run "configure" before trying re-run "make". (starting with "make clean")