求助,我写了一个tuxedo里面嵌入Pro*C的程序,可以用buildserver编译报错!_MQ, Tuxedo及OLTP讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MQ, Tuxedo及OLTP讨论区 »
总帖数
3
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3621 | 回复: 2   主题: 求助,我写了一个tuxedo里面嵌入Pro*C的程序,可以用buildserver编译报错!        下一篇 
zhsgood
注册用户
等级:列兵
经验:102
发帖:70
精华:0
注册:2011-11-28
状态:离线
发送短消息息给zhsgood 加好友    发送短消息息给zhsgood 发消息
发表于: IP:您无权察看 2014-10-11 10:12:23 | [全部帖] [楼主帖] 楼主

#include <stdio.h>

#include <ctype.h>

#include "friend.h"

#include <sqlcode.h>

#include <atmi.h> /* tuxedo Header File */

#include <userlog.h> /* TUXEDO Header File */

/* tpsvrinit is executed when a server is booted, before it begins

processing requests. It is not necessary to have this function.

Also available is tpsvrdone (not used in this example), which is

called at server shutdown time.

*/

EXEC SQL INCLUDE sqlca;

EXEC SQL begin declare section;

static long friend_id;

static char fname[10];

static char fmobile[14];

static char conn[20];

EXEC SQL end declare section;

#ifdef __cplusplus

extern "C"

#endif

void

#if defined(__STDC__) || defined(__cplusplus)

ADD_FRIEND(TPSVCINFO *transb)

#else

ADD_FRIEND(transb)

TPSVCINFO *transb;

#endif

{

    struct friendv *transv;

    transv = (struct friendv*)transb->data;

    friend_id=transv->friend_id;

    strcpy(fname,transv->fname);

    strcpy(fmobile,transv->fmobile);

    strcpy(conn,"admin/keke@denver");

    EXEC SQL CONNECT :conn;

    EXEC SQL insert into FRIEND(FRIEND_ID,NAME,MOBILE)

    value(:friend_id,:fname,:fmoblie);

    if(SQLCODE != SQL_OK){

    userlog("Cannot insert into FRIEND");

    tpreturn(TPFAIL,0,transb->data,0L,0);

    }

    EXEC SQL ROLLBACK WORK RELEASE;

    tpreturn(TPSUCCESS, 0, transb->data, 0L, 0);

}

这个代码编译就报错

 [oracle@Oracle9iDemo simpapp]$ buildserver -f viewserv.c -o viewserv

CMDTUX_CAT:4188: WARN: server built without the -s option cannot advertise services.

viewserv.c:17:21: sqlcode.h: No such file or directory

viewserv.c:26: syntax error before "SQL"

viewserv.c:26: warning: data definition has no type or storage class

viewserv.c:27: syntax error before "SQL"

viewserv.c:27: warning: data definition has no type or storage class

viewserv.c:32: syntax error before "SQL"

viewserv.c:32: warning: data definition has no type or storage class

viewserv.c: In function `ADD_FRIEND':

viewserv.c:91: dereferencing pointer to incomplete type

viewserv.c:92: dereferencing pointer to incomplete type

viewserv.c:93: dereferencing pointer to incomplete type

viewserv.c:95: `EXEC' undeclared (first use in this function)

viewserv.c:95: (Each undeclared identifier is reported only once

viewserv.c:95: for each function it appears in.)

viewserv.c:95: syntax error before "SQL"

viewserv.c:99: `SQLCODE' undeclared (first use in this function)

viewserv.c:99: `SQL_OK' undeclared (first use in this function)

viewserv.c:103: syntax error before "SQL"

CMDTUX_CAT:1832: ERROR: can't execute cc -m32 -I$TUXDIR/include -o viewserv BS-79c9.c -L${TUXDIR}/lib viewserv.c -ltux -lbuft -lfml -lfml32 -lengine -ldl -lpthread

--友情转载




赞(0)    操作        顶端 
koei123
注册用户
等级:大校
经验:4196
发帖:16
精华:0
注册:2011-7-21
状态:离线
发送短消息息给koei123 加好友    发送短消息息给koei123 发消息
发表于: IP:您无权察看 2014-10-11 22:18:16 | [全部帖] [楼主帖] 2  楼

前期有个类似的问题,在坛子上,当时强调了:
(1) 要用proc做下预处理,把.pc文件变成.c文件;
(2) 要把Pro*C的include目录放在-I中;



赞(0)    操作        顶端 
koei123
注册用户
等级:大校
经验:4196
发帖:16
精华:0
注册:2011-7-21
状态:离线
发送短消息息给koei123 加好友    发送短消息息给koei123 发消息
发表于: IP:您无权察看 2014-10-11 22:19:18 | [全部帖] [楼主帖] 3  楼

其实还是忽略了一个很重要的问题,就是:
(3) Tuxedo自己也带了一套模拟SQL的头文件,跟Oracle的会冲突,要把那两个文件改名掉



赞(0)    操作        顶端 
总帖数
3
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论