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:
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):
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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...)
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.
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