- 论坛徽章:
- 0
|
头一次在windows 下使用 proc,预编译失败。代码如下,我想把 test.pc 预编译成 test.cpp
test.pc
- #include <iostream.h>;
- #include <stdio.h>;
- #include <string.h>;
- EXEC SQL INCLUDE sqlca;
- #define UNAME_LEN 20
- #define PWD_LEN 40
- EXEC SQL BEGIN DECLARE SECTION;
- VARCHAR username[UNAME_LEN]; // VARCHAR is an ORACLE supplied struct
- varchar password[PWD_LEN]; // varchar can be in lower case also
- EXEC SQL END DECLARE SECTION;
- int main(void)
- {
- username.len = (unsigned short)strlen(strcpy((char *)username.arr, "SCOTT"));
- password.len = (unsigned short)strlen(strcpy((char *)password.arr, "TIGER"));
- EXEC SQL CONNECT :username IDENTIFIED BY :password;
- EXEC SQL COMMIT WORK RELEASE;
-
- return(0);
- }
复制代码
我是这样预编译的,不知道参数有没有错:
- proc iname=test.pc oname=test.cpp code=cpp parse=none
复制代码
报错如下:
- Pro*C/C++: Release 8.1.7.0.0 - Production on 星期三 5月 12 01:15:41 2004
- (c) Copyright 2000 Oracle Corporation. All rights reserved.
- 系统默认选项值取自于: d:\oracle\ora81\precomp\admin\pcscfg.cfg
- 在第 11 行,第 20 列,文件 cppdemo1.pc 有语义错误:
- VARCHAR username[UNAME_LEN]; // VARCHAR is an ORACLE supplied struct
- ...................1
- PCC-S-02322, 找到未定义的标识符
- 在第 12 行,第 20 列,文件 cppdemo1.pc 有语义错误:
- varchar password[PWD_LEN]; // varchar can be in lower case also
- ...................1
- PCC-S-02322, 找到未定义的标识符
- 在第 11 行,第 20 列,文件 cppdemo1.pc 有语义错误:
- VARCHAR username[UNAME_LEN]; // VARCHAR is an ORACLE supplied struct
- ...................1
- PCC-S-02322, 找到未定义的标识符
- 在第 12 行,第 20 列,文件 cppdemo1.pc 有语义错误:
- varchar password[PWD_LEN]; // varchar can be in lower case also
- ...................1
- PCC-S-02322, 找到未定义的标识符
复制代码
搞了一天都没有头绪,望大家指点一二。谢谢!!! |
|