Operating System - HP-UX
1753470 Members
5092 Online
108794 Solutions
New Discussion юеВ

Errors when compiling on HP-UX 11.0 with cc

 
SOLVED
Go to solution

Errors when compiling on HP-UX 11.0 with cc

Hello,

I got the following messages when I tried to compile a static library on HP-UX 11.0 and cc 11.11.06:

# make -f Makefile libs

**** Compilando o arquivo ct2.c ****
**** used rules -> .c.a ****

/usr/bin/cc -g -Aa -g -Wl,+s -I../include -I/usr/include -I/opt/sybase/include -c ct2.c
cc: "/usr/include/sys/signal.h", line 551: error 1000: Unexpected symbol: "save_state_t".
cc: "/usr/include/sys/signal.h", line 570: error 1000: Unexpected symbol: "ucontext_t".
cc: "/usr/include/sys/signal.h", line 571: error 1000: Unexpected symbol: "sl_si".
cc: "/usr/include/sys/signal.h", line 572: error 1000: Unexpected symbol: "}".
cc: "/usr/include/sys/signal.h", line 595: error 1000: Unexpected symbol: "siginfo_t".
cc: "/usr/include/sys/signal.h", line 627: error 1000: Unexpected symbol: "}".
cc: "/usr/include/math.h", line 32: error 1000: Unexpected symbol: "extern".
cc: "/usr/include/sys/signal.h", line 571: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/usr/include/sys/signal.h", line 595: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/usr/include/sys/signal.h", line 589: error 1574: Unknown size for "sc".
cc: "/usr/include/sys/signal.h", line 589: error 1578: Size of struct or union member is unknown.
cc: "/usr/include/sys/signal.h", line 610: error 1574: Unknown size for "sx".
cc: "/usr/include/sys/signal.h", line 610: error 1578: Size of struct or union member is unknown.
cc: "/usr/include/sys/signal.h", line 608: error 1618: Structure or union type has unknown size.
cc: "/usr/include/math.h", line 33: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/usr/include/sys/signal.h", line 624: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/opt/sybase/include/cstypes.h", line 490: error 1000: Unexpected symbol: "CS_VOIDDATA".
cc: "/opt/sybase/include/cstypes.h", line 515: error 1000: Unexpected symbol: "CS_INT".
cc: "/opt/sybase/include/cstypes.h", line 516: error 1000: Unexpected symbol: "dttime".
cc: "/opt/sybase/include/cstypes.h", line 517: error 1000: Unexpected symbol: "}".
cc: "/opt/sybase/include/cstypes.h", line 521: error 1000: Unexpected symbol: "CS_USHORT".
cc: "/opt/sybase/include/cstypes.h", line 522: error 1000: Unexpected symbol: "minutes".
cc: "/opt/sybase/include/cstypes.h", line 523: error 1000: Unexpected symbol: "}".
cc: "/opt/sybase/include/cstypes.h", line 530: error 1000: Unexpected symbol: "CS_INT".
cc: "/opt/sybase/include/cstypes.h", line 531: error 1000: Unexpected symbol: "mnylow".
cc: "/opt/sybase/include/cstypes.h", line 532: error 1000: Unexpected symbol: "}".
cc: "/opt/sybase/include/cstypes.h", line 536: error 1000: Unexpected symbol: "CS_INT".
cc: "/opt/sybase/include/cstypes.h", line 544: error 1000: Unexpected symbol: "CS_BYTE".
cc: "/opt/sybase/include/cstypes.h", line 545: error 1000: Unexpected symbol: "scale".
cc: "/opt/sybase/include/cstypes.h", line 546: error 1000: Unexpected symbol: "33".
cc: "/opt/sybase/include/cstypes.h", line 546: error 1000: Unexpected symbol: ";".
cc: "/opt/sybase/include/cstypes.h", line 490: error 1584: Inconsistent type declaration: "CS_INT".
cc: "/opt/sybase/include/cstypes.h", line 516: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/opt/sybase/include/cstypes.h", line 516: error 1584: Inconsistent type declaration: "CS_INT".
cc: "/opt/sybase/include/cstypes.h", line 522: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/opt/sybase/include/cstypes.h", line 522: error 1584: Inconsistent type declaration: "CS_USHORT".
cc: "/opt/sybase/include/cstypes.h", line 531: warning 557: Missing declaration specifiers, "int" assumed.
cc: "/opt/sybase/include/cstypes.h", line 531: error 1584: Inconsistent type declaration: "CS_UINT".
cc: "/opt/sybase/include/cstypes.h", line 549: error 1000: Unexpected symbol: "CS_DECIMAL".
cc: "/opt/sybase/include/cstypes.h", line 557: error 1000: Unexpected symbol: "CS_SMALLINT".
cc: "/opt/sybase/include/cstypes.h", line 558: error 1000: Unexpected symbol: "str".
cc: panic 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1

Stop."

Makefile:

#------------------------------------------------------------------------------
#
# Technical Support / Client Server
#
#------------------------------------------------------------------------------

SERVICE =

CC_LOCAL_INCLUDES = -I../include
CC_LOCAL_FLAGS = -g
CC_LOCAL_DEFINES =

LIBRARIES = $(LIBCT2)
LIBCT2 = ../lib/libct2.a
LIB_OBJECTS = $(LIBCT2)(Version.o) \
$(LIBCT2)(ct2.o)

IDLS =

ESQLS =

BINS = ""
BIN_LIBDIRS =
BIN_LIBS =
BIN_OBJECTS =

Target_default:
@echo "ARQUITETURA DE DESENVOLVIMENTO"
@echo "Target Default"
@echo "Escolha um dos targets disponiveis"
@echo "make [libs] [shlibs] [idls] [esql] [bins] [*.o] [*.a]"

${BINS}: $(BIN_OBJECTS)
@echo
@echo "Gerando o executavel ${BINS}"
@`export LDOPTS`
$(CC) $(FLAGS) -o ../bin/$(BINS) $(BIN_OBJECTS) $(INCLUDES) $(DEFINES) $(BIN_LIBDIRS) $(LIBDIRS) $(BIN_LIBS) $(LIBS)
$(RM) -f *.o
$(RM) -f $(ESQLS)
$(RM) -f Version*

include $(ARQDES_HOME)/script/utilit/makesys/platform_hpux.sh
include $(ARQDES_HOME)/script/utilit/makesys/general.sh
include $(ARQDES_HOME)/script/utilit/makesys/sybase.sh


Seems to me that there is a problem with cc header files or is missing some files.

Just to clarify the situation, I'm migrating our development environment from HP-UX 10.20 to HP-UX 11.0.

thanks a lot,

Vlad.
5 REPLIES 5
Mike Stroyan
Honored Contributor
Solution

Re: Errors when compiling on HP-UX 11.0 with cc

It looks like your source may contain
#define _INCLUDE_HPUX_SOURCE
instead of a proper
#define _HPUX_SOURCE

The second form is the correct switch from "man stdsyms". It causes the header files to define several macros via /usr/include/sys/stdsyms.h.

The error that you got would occur if _INCLUDE_HPUX_SOURCE was defined without having _INCLUDE_XOPEN_SOURCE_EXTENDED defined. That normally should not happen.

Re: Errors when compiling on HP-UX 11.0 with cc

Thank you Mike. More one question: We used to put in our sources the following defines:
#define _INCLUDE_POSIX_SOURCE
#define _INCLUDE_XOPEN_SOURCE
#define _INCLUDE_HPUX_SOURCE
#define _INCLUDE_AES_SOURCE

Why I can't use _INCLUDE_HPUX_SOURCE anymore? What had changed?

thanks,

Vlad.
Mike Stroyan
Honored Contributor

Re: Errors when compiling on HP-UX 11.0 with cc

The hard question is not why it fails, but why it ever seemed to work. Perhaps you were compiling in a way that __STDC__ did not get set and stdsyms.h therefore defined _INCLUDE_XOPEN_SOURCE_EXTENDED for you.
The reliable solution is to use the defines documented in "man stdsyms" and never define any of the _INCLUDE_* macros directly.

Re: Errors when compiling on HP-UX 11.0 with cc

Ok Mike...I'll study stdsyms better to understand the whole environment.

thank you,

Vlad.

Re: Errors when compiling on HP-UX 11.0 with cc

I have removed the defines from our sources solving the issue.