redhat linux 엔터프라이즈 4 버전에서 proc를 컴파일 하는 과정에서 아래와 비슷한 내용의 에러가 발생했습니다.
----------------------------------------------------------------------------------
make -f /opt/oracle/product/8.1.7/precomp/demo/proc/demo_proc.mk
OBJS=sample1.o
EXE=sample1 build
make[1]: Entering directory `/opt/oracle/product/8.1.7/precomp/demo/proc'
proc iname=sample1
Pro*C/C++: Release 8.1.7.0.0 - Production on Tue Feb 25 08:51:30 2003
(c) Copyright 2000 Oracle Corporation. All rights reserved.
System default option values taken from:
/opt/oracle/product/8.1.7/precomp/admin/pcscfg.cfg
Error at line 34, column 11 in file /usr/include/stdio.h
# include <stddef.h>
..........1
PCC-S-02015, unable to open include file
Error at line 29, column 10 in file /usr/include/bits/types.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Syntax error at line 48, column 3, file /usr/include/bits/pthreadtypes.h:
Error at line 48, column 3 in file /usr/include/bits/pthreadtypes.h
size_t __guardsize;
..1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:
} char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
The symbol "enum," was substituted for "size_t" to continue.
Syntax error at line 51, column 3, file /usr/include/bits/pthreadtypes.h:
Error at line 51, column 3 in file /usr/include/bits/pthreadtypes.h
size_t __stacksize;
..1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:
} char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
The symbol "enum," was substituted for "size_t" to continue.
Error at line 14, column 10 in file /usr/include/_G_config.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 48, column 10 in file /usr/include/wchar.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Syntax error at line 72, column 5, file /usr/include/wchar.h:
Error at line 72, column 5 in file /usr/include/wchar.h
wint_t __wch;
....1
PCC-S-02201, Encountered the symbol "wint_t" when expecting one of the
following
:
char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
The symbol "enum," was substituted for "wint_t" to continue.
Syntax error at line 29, column 3, file /usr/include/_G_config.h:
Error at line 29, column 3 in file /usr/include/_G_config.h
__mbstate_t __state;
..1
PCC-S-02201, Encountered the symbol "__mbstate_t" when expecting one of the
foll
owing:
} char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
The symbol "enum," was substituted for "__mbstate_t" to continue.
Syntax error at line 34, column 3, file /usr/include/_G_config.h:
Error at line 34, column 3 in file /usr/include/_G_config.h
__mbstate_t __state;
..1
PCC-S-02201, Encountered the symbol "__mbstate_t" when expecting one of the
foll
owing:
} char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
The symbol "enum," was substituted for "__mbstate_t" to continue.
Error at line 48, column 10 in file /usr/include/wchar.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 30, column 10 in file /usr/include/gconv.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Syntax error at line 71, column 26, file /usr/include/gconv.h:
Error at line 71, column 26 in file /usr/include/gconv.h
unsigned char **, size_t *, int, int);
.........................1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:
... auto, char, const, double, enum, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
union, unsigned, utext, uvarchar, varchar, void, volatile,
a typedef name, exec oracle, exec oracle begin, exec,
exec sql, exec sql begin, exec sql type, exec sql var,
The symbol "enum," was substituted for "size_t" to continue.
Syntax error at line 84, column 7, file /usr/include/gconv.h:
Error at line 84, column 7 in file /usr/include/gconv.h
size_t *);
......1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:
... auto, char, const, double, enum, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
union, unsigned, utext, uvarchar, varchar, void, volatile,
a typedef name, exec oracle, exec oracle begin, exec,
exec sql, exec sql begin, exec sql type, exec sql var,
The symbol "enum," was substituted for "size_t" to continue.
Syntax error at line 93, column 6, file /usr/include/gconv.h:
Error at line 93, column 6 in file /usr/include/gconv.h
size_t *);
.....1
PCC-S-02201, Encountered the symbol "size_t" when expecting one of the
following
:
... auto, char, const, double, enum, float, int, long,
ulong_varchar, OCIBFileLocator OCIBlobLocator,
OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
short, signed, sql_context, sql_cursor, static, struct,
union, unsigned, utext, uvarchar, varchar, void, volatile,
a typedef name, exec oracle, exec oracle begin, exec,
exec sql, exec sql begin, exec sql type, exec sql var,
The symbol "enum," was substituted for "size_t" to continue.
Syntax error at line 102, column 3, file /usr/include/gconv.h:
Error at line 102, column 3 in file /usr/include/gconv.h
__gconv_trans_fct __trans_fct;
..1
PCC-S-02201, Encountered the symbol "__gconv_trans_fct" when expecting one
of th
e following:
char, const, double, enum, float, int, long, ulong_varchar,
OCIBFileLocator OCIBlobLocator, OCIClobLocator, OCIDateTime,
OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
OCIRaw, OCIString, short, signed, sql_context, sql_cursor,
struct, union, unsigned, utext, uvarchar, varchar, void,
volatile, a typedef name,
Error at line 53, column 11 in file /usr/include/libio.h
# include <stdarg.h>
..........1
PCC-S-02015, unable to open include file
Error at line 33, column 10 in file /usr/include/string.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 33, column 10 in file /usr/include/stdlib.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 146, column 10 in file /usr/include/sys/types.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Error at line 25, column 10 in file /usr/include/alloca.h
#include <stddef.h>
.........1
PCC-S-02015, unable to open include file
Syntax error at line 0, column 0, file sample1.pc:
Error at line 0, column 0 in file sample1.pc
PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the
following:
----------------------------------------------------------------------------------
상당히 내용이 길지만 결국 include할 파일을 찾을 수 없다는 오류입니다.
그래서 구글을 돌아다닌결과
ORACLE_HOME/precomp/admin/pcscfg.cfg
위의 파일상에 include 경로를 설정해주지 않아서 발생한 문제였습니다.
해결방법은 일단 gcc 컴파일러의 버전을 확인합니다.
----------------------------------------------------------------------------------------------------
gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)
----------------------------------------------------------------------------------------------------
저같은 경우에는 4.1.2버전입니다.
그럼 이제 pcscfg.cfg 파일에 include경로를 설정해줍니다.
------------------------------------------------------------------------------------------
vi pcscfg.cfg
sys_include(/usr/include,/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/usr/lib/gcc-lib/i386-redhat-linux7/2.96/include,/usr/lib/gcc/i386-redhat-linux/4.1.2/include)
------------------------------------------------------------------------------------------
위의 빨간색 글처럼 /usr/lib/gcc/i386-redhat-linux/gcc버전/include 를 추가해줍니다.
위와 같이 설정하고 다시 컴파일하면 오류 없이 컴파일이 되었습니다.