求教Pro*C的问题,请大侠指教!
lnjzpost
|
1#
lnjzpost 发表于 2002-08-13 19:37
求教Pro*C的问题,请大侠指教!
有程序如下:
#include<stdio.h> EXEC SQL include sqlca; main() { char *ConnectStr="scott/tiger"; char Ename[30]; float Salary; EXEC SQL connect :ConnectStr; for(;;) { printf("lease input employee name(or \"exit\"):\n"); scanf("%s", Ename); if(strcmp(Ename, "exit")==0) break; EXEC SQL select sal into :Salary from emp where ename=:Ename; printf("His/her salary is $%.0f.\n", Salary); } } 在使用proc编译时提示如下: [oracle@localhost proc]$ proc iname=proc.pc oname=proc.c Pro*C/C++: Release 8.1.6.0.0 - Production on 星期二 8月 13 19:09:14 2002 (c) Copyright 1999 Oracle Corporation. All rights reserved. System default option values taken from: /Oracle/8.1.6/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 31, column 10 in file /usr/include/gconv.h #include <stddef.h> .........1 PCC-S-02015, unable to open include file Syntax error at line 72, column 26, file /usr/include/gconv.h: Error at line 72, 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 85, column 7, file /usr/include/gconv.h: Error at line 85, 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 94, column 6, file /usr/include/gconv.h: Error at line 94, 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 103, column 3, file /usr/include/gconv.h: Error at line 103, 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 Syntax error at line 0, column 0, file proc.pc: Error at line 0, column 0 in file proc.pc PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the following: ; : an identifier, end-exec, random_terminal Error at line 0, column 0 in file proc.pc PCC-F-02102, Fatal error while doing C preprocessing 不知是怎么回事。 在将第一条语句删除后可能生成proc.c文件并生成以下三个文件: tpAwYcs0.dcl tpfpXZit.cod tpS03M9V.cud 但在用gcc编译proc.c文件时失败并提示如下: /tmp/cccs1dtd.o: In function `main': /tmp/cccs1dtd.o(.text+0x15e): undefined reference to `sqlcxt' /tmp/cccs1dtd.o(.text+0x361): undefined reference to `sqlcxt' collect2: ld returned 1 exit status 小弟反复查看程序也找不出什么原因。 请大侠指教,不胜感激! |