以下是makefile -------------------------------------------------
###### TUXEDO 环境变量 ###############################
COBOPT="-C ANS85 -C ALIGN=8 -C NOIBMCOMP -C TRUNC=ANSI -C OSEXT=cbl"
BEATUX=/home/tuxedo
###### SYBASE 环境变量 ###############################
SYBASE=/home/sybase
SYBASE_FTS=EFTS-12_0
SYBASE_OCS=OCS-12_5
SYBASE_ASE=ASE-12_5
SYBASE_SYSAM=SYSAM-1_0
DSQUERY=SYBASE125
SHLIB_PATH=$(SYBASE)/ASE-12_5/lib:$(SYBASE)/OCS-12_5/lib:/usr/lib:/lib:/usr/lib/Motif1.o:$(BEATUX)/tuxedo9.1/lib:$(SYBASE)/ASE-12_5/lib:$(SYBASE)/OCS-12_5/lib:/usr/lib:/lib:/usr/lib/Motif1.o
LM_LICENSE_FILE=$(SYBASE)/SYSAM-1_0/licenses/license.dat
SYBASE_INCLUDE=$(SYBASE)/OCS-12_5/include
PRECOMP=$(SYBASE)/OCS-12_5/bin/cpre
LIBFLAGS = -L${SYBASE}/${SYBASE_OCS}/lib
INCLUDE = -I. -I${SYBASE}/${SYBASE_OCS}/include -I$(BEATUX)/tuxedo9.1/include
CFLAGS = -I. -I$(SYBASE)/OCS-12_5/include -I$(BEATUX)/tuxedo9.1/include -L$(SYBASE)/OCS-12_5/lib -L$(BEATUX)/tuxedo9.1/lib
###### APP环境变量 ################################
APPBASE=${HOME}/compile/gascard
APPDIR =${HOME}/compile/app
#PATH_INCLUDE = -I${APPBASE}/include -I${SYBASE_INCLUDE} -I$(BEATUX)/tuxedo9.1/include
PATH_INCLUDE = -I${SYBASE_INCLUDE} -I$(BEATUX)/tuxedo9.1/include
ESQLC=$(SYBASE)/OCS-12_5/include/sybesql.c
LIB_SYBASE= -L$(SYBASE)/OCS-12_5/lib -lct -lcs -lsybtcl -lcomn -lintl -lsybdb -ldl -lnsl -lm
#LIB_APP=-L${APPBASE}/lib -lgascard -lcardmac -lhsmapi -lglobalfunc
LIB_APP= -lgascard -lcardmac -lhsmapi -lglobalfunc
CC = gcc
BUILDSERVER=buildserver
#EXECUTABLE= cm_anonymous daily_case
EXECUTABLE= test
all: ${EXECUTABLE}
test: test.o
${BUILDSERVER} -o ./$@ -f test.o \
-f "$(ESQLC)" ${SYBASE_INCLUDE} $(BEATUX)/tuxedo9.1/include -f "$(LIB_SYBASE)" \
-s TEST_1
%.o:%.c
$(CC) -c $(PATH_INCLUDE) $< -m32 -g -w
%.c:%.cp
${SYBASE}/OCS-12_5/bin/cpre $<
#clean:
#
@rm -f ${EXECUTABLE}
#
@rm -f *.c
#
@rm -f *.o
#
@rm -f *.bak
#
@echo Compile ok
接下来是程序----------------------------------------------------
#include <atmi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fml32.h>
#include <userlog.h>
#ifdef __cplusplus
extern "C"
#endif
void
#if defined(__STDC__) || defined(__cplusplus)
TEST_1(TPSVCINFO *rqst)
#else
TEST_1(rqst)
TPSVCINFO *rqst;
#endif
{
tpreturn( TPSUCCESS, 0, (char *)rqst->data, 0, 0 );
}
接下来是make之后的报错------------------------------------------------------------------
/home/sybase/OCS-12_5/bin/cpre test.cp
M_WHEN_ERROR,Unable to find the SQL statement 'WHENEVER SQLERROR'.
M_WHEN_WARN,Unable to find the SQL statement 'WHENEVER WARNING'.
M_WHEN_NF,Unable to find the SQL statement 'WHENEVER NOT FOUND'.
0 Error(s) and 3 Warning(s) found.
Statistical Report:
Program name: cpre
Options specified:
Input file name: test.cp
Listing file name:
Target file name: test.c
ISQL file name:
Tag ID specified:
Compiler used: ANSI_C
Open Client version: CS_VERSION_125
Number of information messages: 11
Number of warning messages: 3
Number of error messages: 0
Number of SQL statements parsed: 1
Number of host variables declared: 8
Number of SQL cursors declared: 0
Number of dynamic SQL statements: 0
Number of stored Procedures generated: 0
Connection(s) information:
User id:
Server:
Database:
gcc -c -I/home/sybase/OCS-12_5/include -I/home/tuxedo/tuxedo9.1/include test.c -m32 -g -w
buildserver -o ./test -f test.o \
-f "/home/sybase/OCS-12_5/include/sybesql.c" /home/sybase/OCS-12_5/include /home/tuxedo/tuxedo9.1/include -f "-L/home/sybase/OCS-12_5/lib -lct -lcs -lsybtcl -lcomn -lintl -lsybdb -ldl -lnsl -lm" \
-s TEST_1
CMDTUX_CAT:520: ERROR: Invalid arguments passed to buildserver
make: *** [test] Error 1
请各位大大帮忙
系统 【redhat5.2 x64】
数据库【sybase 12.5】
中间件【tuxedo 9.1】
cpre -v 看到的信息是
Sybase ESQL/C Precompiler/12.5.1/P-EBF13178 ESD #12/DRV.12.5.1.4/Linux Intel/Linux 2.4.21-20.ELsmp i686/BUILD1251-045/OPT/Mon Jan 16 01:59:18 2006
Confidential property of Sybase, Inc.
Copyright 1987, 2006
Sybase, Inc. All rights reserved.
Unpublished rights reserved under U.S. copyright laws.
This software contains confidential and trade secret information of Sybase,
Inc. Use, duplication or disclosure of the software and documentation by
the U.S. Government is subject to restrictions set forth in a license
agreement between the Government and Sybase, Inc. or other written
agreement specifying the Government's rights to use the software and any
applicable FAR provisions, for example, FAR 52.227-19.
Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA
现在因为项目需要 要用c实现连接sybase并且作为tuxedo的服务使用 所以要用buildserver完成编译
但是现在有这样的问题 请各位帮我看看 谢谢