Ad Widget

Collapse

Compile Errors on Solaris 10

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • offlinetn
    Junior Member
    • Apr 2006
    • 6

    #1

    Compile Errors on Solaris 10

    Hello,

    This is my first post on this forum, I hope im posting it in the right spot. I am trying to compile Zabbix for Solaris 10.

    This is the error I am getting...

    Code:
    ./configure --enable-server --with-mysql=/opt/mysql/mysql --with-net-snmp
    
    ...
    
    # make all
    cd ./base && make
    cd ./cgi && make
    cd ./html && make
    cd ./module && make
    cc -g -Iyes -DHAVE_CONFIG_H -o helloworld.o helloworld.c -Lyes -G -lrt
    "/usr/include/dlfcn.h", line 130: warning: macro redefined: RTLD_NOW
    "/usr/include/dlfcn.h", line 133: warning: macro redefined: RTLD_GLOBAL
    "helloworld.c", line 39: warning: syntax error:  empty declaration
    "helloworld.c", line 68: warning: argument #8 is incompatible with prototype:
            prototype: pointer to void : "../include/nagios.h", line 518
            argument : pointer to function(pointer to char) returning void
    ld: fatal: file helloworld.o: unknown file type
    ld: fatal: File processing errors. No output written to helloworld.o
    *** Error code 1
    make: Fatal error: Command failed for target `helloworld.o'
    Current working directory /www/network.buythetruck.local/nagios-2.2/module
    *** Error code 1
    make: Fatal error: Command failed for target `all'
    I am running Solaris 10 (sparc) and Sun Studio 11 cc

    Any help would be appreciated.

    Thanks,

    Chris Edwards
  • elkor
    Senior Member
    • Jul 2005
    • 299

    #2
    are you in the right directory?????

    Current working directory /www/network.buythetruck.local/nagios-2.2/module

    Comment

    • offlinetn
      Junior Member
      • Apr 2006
      • 6

      #3
      I think so...

      Code:
      # pwd
      /www/network.buythetruck.local/nagios-2.2
      #

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        NAGIOS?! Heh...
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • offlinetn
          Junior Member
          • Apr 2006
          • 6

          #5
          Shesh, you can tell I had a long day yesterday. I was trying to compile both to evalute them. Here is the end of my Zabbix make....

          Code:
          cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I/opt/mysql/mysql/include -I/usr/local/include    -g -c actions.c
          source='zlog.c' object='zlog.o' libtool=no \
          DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
          cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I/opt/mysql/mysql/include -I/usr/local/include    -g -c zlog.c
          source='functions.c' object='functions.o' libtool=no \
          DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
          cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I/opt/mysql/mysql/include -I/usr/local/include    -g -c functions.c
          source='server.c' object='server.o' libtool=no \
          DEPDIR=.deps depmode=none /bin/bash ../../depcomp \
          cc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I/opt/mysql/mysql/include -I/usr/local/include    -g -c server.c
          "/usr/local/include/net-snmp/net-snmp-config.h", line 925: warning: macro redefined: PACKAGE_BUGREPORT
          "/usr/local/include/net-snmp/net-snmp-config.h", line 928: warning: macro redefined: PACKAGE_NAME
          "/usr/local/include/net-snmp/net-snmp-config.h", line 931: warning: macro redefined: PACKAGE_STRING
          "/usr/local/include/net-snmp/net-snmp-config.h", line 934: warning: macro redefined: PACKAGE_TARNAME
          "/usr/local/include/net-snmp/net-snmp-config.h", line 937: warning: macro redefined: PACKAGE_VERSION
          "/usr/local/include/net-snmp/library/parse.h", line 32: warning: macro redefined: MAXLABEL
          cc  -g   -o zabbix_server -L/opt/mysql/mysql/lib   -L/usr/local/lib  evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxsysinfo/solaris/libzbxsysinfo2.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a  ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcommon/libzbxcommon.a -lmysqlclient -lm   -lnetsnmp  -lkvm -lresolv -lnsl -lkstat -lsocket
          Undefined                       first referenced
           symbol                             in file
          uncompress                          /opt/mysql/mysql/lib/libmysqlclient.a(my_compress.o)
          compress                            /opt/mysql/mysql/lib/libmysqlclient.a(my_compress.o)
          ld: fatal: Symbol referencing errors. No output written to zabbix_server
          make[3]: *** [zabbix_server] Error 1
          make[3]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src/zabbix_server'
          make[2]: *** [all-recursive] Error 1
          make[2]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src/zabbix_server'
          make[1]: *** [all-recursive] Error 1
          make[1]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src'
          make: *** [all-recursive] Error 1
          #

          Comment

          • markpr
            Member
            • Sep 2005
            • 31

            #6
            Hi,

            Are you using the Sun Compiler or GCC? If you're using GCC (probably a better bet for open source) have you also installed AutoConf, AutoMake, Bison, Flex, Gawk, Gnu Sed, Gnu Awk and all the other stuff that you need? If not you might want to start with that for getting a good development environment up and running on Solaris 10.

            A good site for these in packages is www.sunfreeware.com but there's still not as much for Solaris 10 as there is for Solaris 9. If you do get a good gcc build environment going then let me know how you did it... I lost patience after a long while and switched back to Linux (and I like using Solaris for almost everything else).

            Mark

            Comment

            • offlinetn
              Junior Member
              • Apr 2006
              • 6

              #7
              Mark,

              Thanks for the input.

              I am using Sun's compiler, it has worked like a champ for me on almost everything, I do have the gcc libs installed in /usr/local/lib.

              I have most of the important pkgs on the machine. I ftped the entire SunFreeware site to my drive just after setup so I could install pkgs quickly and easily as new programs needed them.

              Unfortunately I still can't get a good build of Zabbix.

              Thanks,

              Chris Edwards

              Comment

              • elkor
                Senior Member
                • Jul 2005
                • 299

                #8
                wow, I have never had a good (recent) copy of sun's cc.

                anyway, all the solaris9 packages should do just fine on sol10.

                I'd change the cc variable to = "gcc" and try rebuilding, sun's compiler can be flaky when looking for additional libraries and it may have a problem linking against libraries compiled with gcc like your output shows on the ld command

                (well, no might about it really, it WILL.. you just get away with it sometimes)

                Comment

                • markpr
                  Member
                  • Sep 2005
                  • 31

                  #9
                  One thing I never thought to try was to just use the Sol9 packages. I might give that another go because I have quite a few older sparc machines hanging around. I might give this another go next week but for speed might just use Sol9 as the base (I have a flar for sol9 but not for 10). Chris - if I have any better luck I'll let you know...

                  Comment

                  • elkor
                    Senior Member
                    • Jul 2005
                    • 299

                    #10
                    No problem man, I'll be around

                    Comment

                    • offlinetn
                      Junior Member
                      • Apr 2006
                      • 6

                      #11
                      Thanks for all of the input, I installed GCC onto the sparc and here is what I get for errors now when I do a make...

                      Code:
                      # make
                      Making all in src
                      make[1]: Entering directory `/export/home/chris/Sources/zabbix-1.1beta9/src'
                      Making all in libs
                      make[2]: Entering directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs'
                      Making all in zbxcommon
                      make[3]: Entering directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs/zbxcommon'
                      make[4]: Entering directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs/zbxcommon'
                      if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include     -g -O2 -MT base64.o -MD -MP -MF ".deps/base64.Tpo" -c -o base64.o base64.c; \
                      then mv -f ".deps/base64.Tpo" ".deps/base64.Po"; else rm -f ".deps/base64.Tpo"; exit 1; fi
                      if gcc -DHAVE_CONFIG_H -I. -I. -I../../../include     -g -O2 -MT misc.o -MD -MP -MF ".deps/misc.Tpo" -c -o misc.o misc.c; \
                      then mv -f ".deps/misc.Tpo" ".deps/misc.Po"; else rm -f ".deps/misc.Tpo"; exit 1; fi
                      In file included from /usr/include/sys/signal.h:34,
                                       from /usr/include/signal.h:26,
                                       from ../../../include/sysinc.h:111,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
                      /usr/include/sys/siginfo.h:292: error: parse error before '}' token
                      /usr/include/sys/siginfo.h:294: error: parse error before '}' token
                      /usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
                      /usr/include/sys/siginfo.h:392: error: conflicting types for `__proc'
                      /usr/include/sys/siginfo.h:261: error: previous declaration of `__proc'
                      /usr/include/sys/siginfo.h:398: error: conflicting types for `__fault'
                      /usr/include/sys/siginfo.h:267: error: previous declaration of `__fault'
                      /usr/include/sys/siginfo.h:404: error: conflicting types for `__file'
                      /usr/include/sys/siginfo.h:273: error: previous declaration of `__file'
                      /usr/include/sys/siginfo.h:420: error: conflicting types for `__prof'
                      /usr/include/sys/siginfo.h:287: error: previous declaration of `__prof'
                      /usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl'
                      /usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl'
                      /usr/include/sys/siginfo.h:426: error: parse error before '}' token
                      /usr/include/sys/siginfo.h:428: error: parse error before '}' token
                      /usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
                      /usr/include/sys/siginfo.h:437: error: parse error before '}' token
                      In file included from /usr/include/signal.h:26,
                                       from ../../../include/sysinc.h:111,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/signal.h:85: error: parse error before "siginfo_t"
                      In file included from ../../../include/sysinc.h:111,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/signal.h:111: error: parse error before "siginfo_t"
                      /usr/include/signal.h:113: error: parse error before "siginfo_t"
                      In file included from /usr/include/sys/klwp.h:21,
                                       from /usr/include/sys/thread.h:13,
                                       from /usr/include/sys/proc.h:20,
                                       from ../../../include/sysinc.h:127,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/contract.h:58: error: parse error before "ctid_t"
                      /usr/include/sys/contract.h:68: error: parse error before '}' token
                      /usr/include/sys/contract.h:71: error: parse error before "ctid_t"
                      /usr/include/sys/contract.h:86: error: parse error before '}' token
                      In file included from /usr/include/sys/thread.h:13,
                                       from /usr/include/sys/proc.h:20,
                                       from ../../../include/sysinc.h:127,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/klwp.h:96: error: parse error before "k_siginfo_t"
                      /usr/include/sys/klwp.h:171: error: parse error before '}' token
                      In file included from /usr/include/sys/proc.h:20,
                                       from ../../../include/sysinc.h:127,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/thread.h:145: error: parse error before "klwp_t"
                      /usr/include/sys/thread.h:320: error: parse error before '}' token
                      In file included from ../../../include/sysinc.h:127,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/proc.h:62: error: parse error before "kthread_t"
                      /usr/include/sys/proc.h:68: error: parse error before '}' token
                      /usr/include/sys/proc.h:183: error: parse error before "kthread_t"
                      /usr/include/sys/proc.h:200: error: parse error before '*' token
                      /usr/include/sys/proc.h:297: error: parse error before '*' token
                      /usr/include/sys/proc.h:310: error: parse error before '}' token
                      In file included from ../../../include/sysinc.h:133,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/sys/procfs.h:108: error: parse error before "siginfo_t"
                      /usr/include/sys/procfs.h:130: error: parse error before '}' token
                      /usr/include/sys/procfs.h:164: error: parse error before "lwpstatus_t"
                      In file included from ../../../include/sysinc.h:205,
                                       from ../../../include/common.h:23,
                                       from misc.c:1:
                      /usr/include/kvm.h:44: error: parse error before '*' token
                      /usr/include/kvm.h:45: error: parse error before '*' token
                      /usr/include/kvm.h:48: error: parse error before "proc_t"
                      make[4]: *** [misc.o] Error 1
                      make[4]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs/zbxcommon'
                      make[3]: *** [all-recursive] Error 1
                      make[3]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs/zbxcommon'
                      make[2]: *** [all-recursive] Error 1
                      make[2]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src/libs'
                      make[1]: *** [all-recursive] Error 1
                      make[1]: Leaving directory `/export/home/chris/Sources/zabbix-1.1beta9/src'
                      make: *** [all-recursive] Error 1
                      #

                      Comment

                      • ptribble
                        Junior Member
                        • May 2006
                        • 6

                        #12
                        You don't need to install gcc on Solaris 10 - it should already be installed.

                        Add /usr/sfw/bin to your PATH and you should be set.

                        Using a gcc built on a different Solaris version is likely to be nothing but trouble.

                        I didn't have any problems building zabbix 1.1b9 on Solaris 10 sparc.

                        Solaris 10 comes with mysql as well, and I built against that: --with-mysql=/usr/sfw

                        Comment

                        • offlinetn
                          Junior Member
                          • Apr 2006
                          • 6

                          #13
                          Acctually I go it to work with GCC on Solaris, I had to recompile the headers...

                          Code:
                          Juergen.Keil 
                          Posts:469 
                          Registered: 10/27/04  Re: where is ctid_t defined? (Solaris 10)    
                          Nov 17, 2004 10:37 AM (reply 1 of 13) 
                            
                          
                            
                            ctid_t is defined in /usr/include/sys/types.h ("typedef id_t ctid_t;").
                          
                          I guess what has happend is that you're using a gcc compiler that
                          was build on Solaris 9 (or some other Solaris release older than 
                          Solaris 10 b69), and this gcc release has a set of "fixed" gcc specific
                          headers that don't match your s10b69 system headers any more.
                          
                          The fix is to build a fresh set of gcc "fixed" headers:
                          
                          # cd /opt/sfw/gcc-3/lib/gcc-lib/i386-pc-solaris2.9/3.3.2/install-tools/ 
                           
                          # cat > mkheaders.conf
                          SHELL=/bin/sh
                          SYSTEM_HEADER_DIR="/usr/include"
                          OTHER_FIXINCLUDES_DIRS=""
                          FIXPROTO_DEFINES="-D_XOPEN_SOURCE"
                          STMP_FIXPROTO="stmp-fixproto"
                          STMP_FIXINC="stmp-fixinc"
                          ^D
                           
                          # ./mkheaders

                          Comment

                          Working...