Page 1 of 1

Solaris on sparc

Posted: Mon Dec 26, 2005 10:21 pm
by waterboy
I am looking for the binary of zoneminder (solaris9 on sparc). it wont compile on my system. Here are the errors i get

Code: Select all

make  all-recursive

Making all in src

if g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/opt/csw/mysql4/include -I/opt/csw/incl\

then mv -f ".deps/zmc.Tpo" ".deps/zmc.Po"; else rm -f ".deps/zmc.Tpo"; exit 1; i

zmc.cpp:20:36: /usr/bin/getopt/getopt.h: No such file or directory

In file included from zmc.cpp:24:

zm.h:28:23: zm_config.h: No such file or directory

In file included from zm_zone.h:27,

                 from zm_monitor.h:29,

                 from zmc.cpp:26:

zm_event.h: In static member function `static void Event::Initialise()':

zm_event.h:88: error: `config' undeclared (first use this function)

zm_event.h:88: error: (Each undeclared identifier is reported only once for eac)

zm_event.h:88: error: `ZM_TIMESTAMP_ON_CAPTURE' undeclared (first use this func)

zm_event.h:89: error: `ZM_BULK_FRAME_INTERVAL' undeclared (first use this funct)

zm_event.h:90: error: `ZM_EVENT_IMAGE_DIGITS' undeclared (first use this functi)

In file included from zm_monitor.h:29,

                 from zmc.cpp:26:

zm_zone.h: In static member function `static void Zone::Initialise()':

zm_zone.h:89: error: `config' undeclared (first use this function)

zm_zone.h:89: error: `ZM_RECORD_DIAG_IMAGES' undeclared (first use this functio)

zm_zone.h:90: error: `ZM_CREATE_ANALYSIS_IMAGES' undeclared (first use this fun)

In file included from zm_monitor.h:30,

                 from zmc.cpp:26:

zm_camera.h:25:28: linux/videodev.h: No such file or directory

In file included from zmc.cpp:26:

zm_monitor.h: In static member function `static void Monitor::Initialise()':

zm_monitor.h:174: error: `config' undeclared (first use this function)

zm_monitor.h:174: error: `ZM_RECORD_EVENT_STATS' undeclared (first use this fun)
zm_monitor.h:175: error: `ZM_RECORD_DIAG_IMAGES' undeclared (first use this fun)
zm_monitor.h:176: error: `ZM_OPT_ADAPTIVE_SKIP' undeclared (first use this func)
zm_monitor.h:177: error: `ZM_CREATE_ANALYSIS_IMAGES' undeclared (first use this)
zm_monitor.h:178: error: `ZM_BLEND_ALARMED_IMAGES' undeclared (first use this f)
zm_monitor.h:179: error: `ZM_TIMESTAMP_ON_CAPTURE' undeclared (first use this f)
zm_monitor.h:180: error: `ZM_BULK_FRAME_INTERVAL' undeclared (first use this fu)
zmc.cpp: In function `int main(int, char**)':
zmc.cpp:64: error: elements of array `option long_options[]' have incomplete tye
zmc.cpp:64: error: storage size of `long_options' isn't known
zmc.cpp:70: error: `getopt_long' undeclared (first use this function)
zmc.cpp:144: error: `zmLoadConfig' undeclared (first use this function)
zmc.cpp:210: error: `config' undeclared (first use this function)
zmc.cpp:210: error: `ZM_NO_MAX_FPS_ON_ALARM' undeclared (first use this functio)
zmc.cpp:56: error: storage size of `long_options' isn't known
*** Error code 1
make: Fatal error: Command failed for target `zmc.o'
Current working directory /tmp/zm-1.21.0/src
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/zm-1.21.0
*** Error code 1
make: Fatal error: Command failed for target `all'

thanks

Posted: Mon Dec 26, 2005 10:49 pm
by cordel
The files it's tring to include ( /usr/bin/getopt/getopt.h: No such file or directory ) come from the glibc-headers package. I'm not sure how this works out on solaris or if it's even possible. I also don't recall anyone here even tring (at least no one has posted anything here). It's possible you may be on your own for the most part and we'll do our best to assist.

glibc-headers package contains the header files necessary
for developing programs which use the standard C libraries (which are
used by nearly all programs). If you are developing programs which
will use the standard C libraries, your system needs to have these
standard header files available in order to create the
executables.

Regards,
Corey

Compiling blues

Posted: Mon Jan 02, 2006 10:46 pm
by waterboy
WIth the info you gave me i was able to find some info on the web. HEre is what i found from http://molpopgen.org/krthornt/GCCSolaris.html
When getopt doesn't work on solaris as it does on linux:
The reson for this is that the getopt() function is defined in <unistd.h> in the Solaris C library, whereas its in <getopt.h> on Linux systems. Also, Apple's OS X port of gcc declares getopt in <unistd.h>, just like the Sun systems. Here is the fix I use:

/*
Apple (OS X) and Sun systems declare getopt in unistd.h,
other systems (Linux) use getopt.h
*/
#if defined ( __APPLE__ ) || ( defined (__SVR4) && defined (__sun) )
#include <unistd.h>
#else
#include "getopt.h"
#endif
This got me past the error with getopt.h..

next i got an error
zm.h:28:23: zm_config.h: No such file or directory

In file included from zm_zone.h:27,

from zm_monitor.h:29,

from zmc.cpp:38:
so in the src subdirectory i did this

Code: Select all

cp zm_config.h.z zm_config.h
well this did not solv the problem. SO i tryed the other option the site propose. a SOlaris version of getopt ( from the same url as above).

WIth this i got a lot less errors. but
Making all in src
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/csw/mysql4/include -I/opt/csw/inclu
de -g -O2 -MT zmc.o -MD -MP -MF ".deps/zmc.Tpo" -c -o zmc.o zmc.cpp; \
then mv -f ".deps/zmc.Tpo" ".deps/zmc.Po"; else rm -f ".deps/zmc.Tpo"; exit 1; f
i
In file included from zm_debug.h:122,
from zm.h:25,
from zmc.cpp:26:
/opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.4/include/stdio.h:287: error: dec
laration of C function `int getopt(int, char* const*, const char*)' conflicts wi
th
./getopt.h:136: error: previous declaration `int getopt()' here
In file included from zm_monitor.h:30,
from zmc.cpp:28:
zm_camera.h:25:28: linux/videodev.h: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `zmc.o'
Current working directory /tmp/zm-1.21.0/src
*** Error code 1
make: Fatal error: Command failed for target `all-recursive'
Current working directory /tmp/zm-1.21.0
*** Error code 1
make: Fatal error: Command failed for target `all'
Now i am stump again... with the (int getopt(int, char* const*, const char*)' conflicts)

THanks for the gideing light... AND HAppy new year to ALL

Compiling !@#$%

Posted: Wed Jan 04, 2006 8:38 pm
by waterboy
HI again

For the videodev lib I found on source forge an equivalent.
(http://bt848x.sourceforge.net/index.html#dir)

I still have my getopt error. I look at declaration in stdio.h (extern int getopt(int, char *const *, const char *);)

That looks ok to me, Can anyone help?

Anyone

Posted: Fri Jan 06, 2006 5:36 pm
by waterboy
Anyone?

Posted: Sat Jan 07, 2006 9:34 pm
by zoneminder
I don't have a Solaris machine to test on I'm afraid.

You should't rename zm_config.h.z to zm_config.h though. The zmconfig.pl script will produce it (and do substitutions) when you you it.