1.21.0 is missing the definition of round

Support and queries relating to all previous versions of ZoneMinder
Locked
shanselman
Posts: 4
Joined: Wed Mar 23, 2005 11:59 am

1.21.0 is missing the definition of round

Post by shanselman »

If you don't have round as a builtin the new 1.21.0 fails with a missing declaration.

(HAVE_DECL_ROUND false)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Can you give a few more details? Distro, version etc. Plus did 1.20.1 build correctly? Ie. are you saying this is a new issue?

Phil
shanselman
Posts: 4
Joined: Wed Mar 23, 2005 11:59 am

Post by shanselman »

Yes, 1.20.1 built correctly as it didn't use round, 1.21.0 now fails as round isn't defined.

make all-recursive
make[1]: Entering directory `/mnt/c1/src/zm-1.21.0'
Making all in src
make[2]: Entering directory `/mnt/c1/src/zm-1.21.0/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include -I/usr/local/include -g -O2 -MT zm_zone.o -MD -MP -MF ".deps/zm_zone.Tpo" -c -
o zm_zone.o zm_zone.cpp; \
then mv -f ".deps/zm_zone.Tpo" ".deps/zm_zone.Po"; else rm -f ".deps/zm_zone.Tpo"; exit 1; fi
In file included from zm_zone.h:25,
from zm_zone.cpp:22:
zm_box.h: In method `const Coord Box::Centre () const':
zm_box.h:60: `round' undeclared (first use this function)
zm_box.h:60: (Each undeclared identifier is reported only once for each
function it appears in.)
In file included from zm_zone.h:26,
from zm_zone.cpp:22:
zm_image.h: At top level:
zm_image.h:34: `double round (double)' used prior to declaration
make[2]: *** [zm_zone.o] Error 1
make[2]: Leaving directory `/mnt/c1/src/zm-1.21.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/c1/src/zm-1.21.0'
make: *** [all] Error 2

Linux 2.4.28 with gcc 2.96
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks for that. Previous versions did use round but the header that defined it if it wasn't found is not included in zm_box.h.

To get round ( :lol: ) this you can edit zm.h and add the following lines

Code: Select all

extern "C"
{
#if !HAVE_DECL_ROUND
double round(double);
#endif
}
just under the line

Code: Select all

#include "zm_config.h"
To be safe you could also delete the lines

Code: Select all

#if !HAVE_DECL_ROUND
double round(double);
#endif
from zm_image.h as well, though I don't think it should cause a problem if you left them. Let me know how you get on. It's a little hard for me to test as I don't have access to a system which doesn't have it.

Phil
shanselman
Posts: 4
Joined: Wed Mar 23, 2005 11:59 am

Post by shanselman »

Yep, it's built ok and started ok.
shanselman
Posts: 4
Joined: Wed Mar 23, 2005 11:59 am

Post by shanselman »

Should have also mentioned that I deleted the definition from zm_image.h as well.
Locked