Menu

compiling projects in solaris 8 (ultrasparc)

Help
2001-05-03
2001-05-10
  • Dave Huseby

    Dave Huseby - 2001-05-03

    I managed to get CommonC++ to compile under solaris but now my project which compiles fine in linux and win32 is generating one tiny error that I have no idea how to fix.  Here's the output:
    In file included from /usr/local/include/cc++/config.h:345,
    from /usr/local/include/cc++/thread.h:61,
                     from global.h:7,
                     from global.cpp:1:
    /usr/include/signal.h:77: parse error before `*'

    now I'm assuming this is because I am not defining something in the compilation command...here's what I'm defining now:

    g++  -I. -O2 -g3 -Wall  -D_REENTRANT -DTHREAD_SAFE -D_XOPEN_SOURCE=500   -c global.cpp

    any suggestions?

    Dave

     
    • Dave Huseby

      Dave Huseby - 2001-05-03

      P.S. I have compiled and install a complete GNU dev environment on my sun box (i.e. gcc, g++, libstdc++, make, ld, ar, etc...)

       
    • David Sugar

      David Sugar - 2001-05-09

      What is in the include file in question there?  I am guessing it is a typedef'd type that is defined in another header that is not being included.

       
    • Dave Huseby

      Dave Huseby - 2001-05-10

      OK, here's the deal.  I'm getting this error:
      /usr/include/signal.h:77: parse error before `*'

      signal.h is included from the cc++/config.h file.  this works fine on linux because I assume there is a GNU specific version of this that works with other GNU code, but in the case of Solaris 8 it is a file contributed by AT&T.  The actual part of the header that is in question looks like this (lines 71-81):

      #if defined(__EXTENSIONS__) || (__STDC__ == 0 &&\ !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE))
      #include <sys/procset.h>
      extern int gsignal(int);
      extern int (*ssignal(int, int (*)(int)))(int);
      extern int sigsend(idtype_t, id_t, int);
      extern int sigsendset(const procset_t *, int);
      extern int sig2str(int, char *);
      extern int str2sig(const char *, int *);
      #define SIG2STR_MAX     32
      #endif /* defined(__EXTENSIONS__) || (__STDC__ == 0 ... */

      So clearly the error is a result of procset_t struct not being defined...procset_t is defined in <sys/procset.h> on Solaris so I opened it up to see why it wasn't defining procset_t properly.  Here's the block of code (I cut out the non-important stuff):

      #if !defined(_XPG4_2) || defined(__EXTENSIONS__)

      ...

      typedef struct procset {
      ...
      } procset_t;

      ...

      #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */

      so clearly the __EXTENSIONS__ item was not being defined so I went back to cc++/config.h to find out why:

      #if defined(__sun) || defined(__SUN__)
      #define __EXTENSIONS__
      #endif

      so, __sun or __SUN__ needs to be defined to get __EXTENSIONS___ to get procset_t...BUT compiling with:
      g++ -I. -O2 -g3 -Wall -D__SUN__ -DHAVE_CONFIG_H -D_REENTRANT -DTHREAD_SAFE -D_XOPEN_SOURCE=500 global.cpp

      still gives me the parse error in signal.h...I'm stumped.  I don't know why procset_t is not getting defined.  All of this comes from the cc++/config.h file too.  On line 345 in cc++/config.h it includes signal.h which has the error in it.  I hope this sheds more light on the problems I'm having.  Thanks ahead of time.

      Dave

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.