Operating System - HP-UX
1832891 Members
2378 Online
110048 Solutions
New Discussion

Re: "/usr/include/stdlib.h", line 48 # Unexpected '{'.

 
Graham_26
New Member

"/usr/include/stdlib.h", line 48 # Unexpected '{'.

I'm trying to build an application written by someone else on my machine but I'm seeing rather odd errors, hopefully someone will be able to tell me what obvious thing I'm doing wrong.

I'm using HP/UX 11.0 with the following version of 'aCC':

aCC: HP ANSI C++ B3910B A.03.30

I'm guessing this problem is becaus I have a different version of the aCC compiler ???


/opt/aCC/bin/aCC -c -DIT_EX_MACROS -DCORBA_LONG_MAX=4294967295 +DAportable -D_POSIX_C_SOURCE=199506L -D_THREAD_SAFE -D_HPUX_SOURCE -DNO_VF_ABORT -DRW_MULTI_THREAD -DRW_BROKEN_TEMPLATES -DRW_COMPILE_INSTANTIATE -ext -D_CMA_NOWRAPPERS -D_CMA_NOWRAPPERS_ -D_REENTRANT -D__VF_THREADS -I/include -I +O2 -g0 -I. -I/var/tmp/iona/include/OB -I/var/tmp/iona/include -I/SecureAPI/IDL -I/SecureAPI/Implementation/SecureAPI -I/SecureAPI/Implementation/SecureAPI/SMS -I/SecureAPI/ServerFoundation -I/SecureAPI/Comm -I/SecureAPI/Sys -I/idl -I/include -I/usr/include -o ClientSecurityFilter.o ClientSecurityFilter.C
Error 19: "/usr/include/stdlib.h", line 48 # Unexpected '{'.
extern "C" {
^
Error 496: "/usr/include/stdlib.h", line 48 # The linkage specification must occur at global
(file) scope.
extern "C" {
^^^
Warning 867: "/usr/include/stdlib.h", line 55 # 'extern' specifier is repeated in declaration.
extern int __nl_char_size;
^^^^^^
Error 19: "/usr/include/sys/wait.h", line 55 # Unexpected '{'.
extern "C" {
^
Error 496: "/usr/include/sys/wait.h", line 55 # The linkage specification must occur at global
(file) scope.
extern "C" {
^^^
Warning 867: "/usr/include/sys/wait.h", line 63 # 'extern' specifier is repeated in declaration.
extern pid_t wait(int *);
^^^^^^
Error 270: "/usr/include/stdlib.h", line 55 # Member "int CORBA::__nl_char_size" may not be
declared extern.
extern int __nl_char_size;
^^^^^^^^^^^^^^
Error 270: "/usr/include/stdlib.h", line 91 # Member "double CORBA::atof(const char *)" may not be
declared extern.
extern double atof(const char *);
^^^^
Error 270: "/usr/include/stdlib.h", line 93 # Member "int CORBA::atoi(const char *)" may not be
declared extern.
extern int atoi(const char *);
^^^^
Error 270: "/usr/include/stdlib.h", line 94 # Member "long CORBA::atol(const char *)" may not be
declared extern.
extern long int atol(const char *);
^^^^
Error 270: "/usr/include/stdlib.h", line 95 # Member "double CORBA::strtod(const char *,char **)"
may not be declared extern.
extern double strtod(const char *, char **);
^^^^^^
Error 270: "/usr/include/stdlib.h", line 96 # Member "long CORBA::strtol(const char *,char
**,int)" may not be declared extern.
extern long int strtol(const char *, char **, int);
^^^^^^
Error 270: "/usr/include/stdlib.h", line 97 # Member "unsigned long CORBA::strtoul(const char
*,char **,int)" may not be declared extern.
extern unsigned long int strtoul(const char *, char **, int);
^^^^^^^
Error 270: "/usr/include/stdlib.h", line 98 # Member "int CORBA::rand()" may not be declared
extern.
extern int rand(void);
^^^^
Error 699: "/usr/include/stdlib.h", line 98 # Error limit reached; halting compilation.
extern int rand(void);
^^^^
*** Error exit code 2

3 REPLIES 3
Amin Jaffer_1
Occasional Advisor

Re: "/usr/include/stdlib.h", line 48 # Unexpected '{'.


hi

can you try to compile the following using the same flags that you are using, i just want to see if it something in stdlib or something in the compiler.

opt/aCC/bin/aCC -c -DIT_EX_MACROS -DCORBA_LONG_MAX=4294967295 +DAportable -D_POSIX_C_SOURCE=199506L -D_THREAD_SAFE -D_HPUX_SOURCE -DNO_VF_ABORT -DRW_MULTI_THREAD -DRW_BROKEN_TEMPLATES -DRW_COMPILE_INSTANTIATE -ext -D_CMA_NOWRAPPERS -D_CMA_NOWRAPPERS_ -D_REENTRANT -D__VF_THREADS -I/include -I +O2 -g0 -I. -I/var/tmp/iona/include/OB -I/var/tmp/iona/include -I/SecureAPI/IDL -I/SecureAPI/Implementation/SecureAPI -I/SecureAPI/Implementation/SecureAPI/SMS -I/SecureAPI/ServerFoundation -I/SecureAPI/Comm -I/SecureAPI/Sys -I/idl -I/include -I/usr/include -o testcompile.o testcompile.cpp

RolandH
Honored Contributor

Re: "/usr/include/stdlib.h", line 48 # Unexpected '{'.

See also this patch --> PHCO_26111 s700_800 11.00 libc cumulative header file patch

HTH
Roland
Sometimes you lose and sometimes the others win
Elmar P. Kolkman
Honored Contributor

Re: "/usr/include/stdlib.h", line 48 # Unexpected '{'.

Also the code before the #include could cause errors like this. Which is found when trying to compile the source sent in a previous reply.
Every problem has at least one solution. Only some solutions are harder to find.