Hi, I find it easier to compile the *.c and *.b into one shared library as follows (works for me in jBASE 5):
jcompile TEST.BP/CTest.c TEST.BP/Simple.c TEST.BP/VCHKXVERIFYPAYPWD.b -d -s xllib/TESTLIBRARY.so Directories TEST.BP and xllib are off the current directory (bnk.run if T24) otherwise change accordingly. xllib is in your JBCOBJECTLIST. After successful compilation, log out of AIX and log back in then fire your test. Regards, On 21 June 2012 12:22, Jim.cnt <[email protected]> wrote: > Hi, > Sorry! The code line 'STORE_BBS(strErrmsg, prtErrmsg); ' in simple.c > is redundant', so simple.c needn't include 'jsystem.h' header. I > delete this line, as follows > > source Simple.c > > #include "simple.h" > int VerifyPayCodeAAA(unsigned char* pClientPkg,unsigned char* > strErrmsg) { > char *prtErrmsg; > memcpy(strErrmsg, "hello, this is test", 30); > return 0; > } > > > After run the ksh script to compile and link, I run TESTCHK, the same > error message is thrown. > > I will use DEFCE to test. > > Do you think my ksh script is correct fully?. > > Thanks & Regards, > > On 6月21日, 下午4时09分, Marco Manyevere <[email protected]> wrote: > > Hi, > > > > Is because you don't #include <jsystem.h> in Simple.c. Having made that > > correction you may need to pay attention to what the program is actually > > trying to do because I think after that correction it probably won't > > compile or run correctly. > > > > I always try and keep the C code from mixing with jBASE undocumented > > functions and its usually easy to do except in very complicated > situations. > > In most cases you can get away by using the simpler DEFCE interface. > > > > Regards, > > > > On 21 June 2012 04:40, Jim.cnt <[email protected]> wrote: > > > > > > > > > hi, > > > For requirement,I write a jbase subroutine and two C program. They > > > are named VCHKXVERIFYPAYPWD.b, CTest.c and Simple.c . Their Logics are > > > that VCHKXVERIFYPAYPWD.b call CTest.c and CTest.c call Simple.c . > > > I use ksh script complie and link those .b and .c program. Ksh script > > > runs successfully. > > > After running ksh script, I use a jbase program 'TESTCHK' call > > > subroutine VCHKXVERIFYPAYPWD and error messge is thrown as the > > > following: > > > > > jBASE: /app/t24core/bnk/bnk.run/xllib/libdraft.so: rtld: 0712-001 > > > Symbol STORE_BBS was referenced > > > from module /app/t24core/bnk/bnk.run/xllib/libcipher.a(), but a > > > runtime definition > > > of the symbol was not found. > > > rtld: 0712-002 fatal error: exiting. > > > ** Error [ SUBROUTINE_CALL_FAIL ] ** > > > Unable to perform CALL to subroutine VCHKXVERIFYPAYPWD , Line 3 , > > > Source TESTCHK > > > Press C to continue or Q to quit > > > Trap from an error message, error message name = SUBROUTINE_CALL_FAIL > > > Source changed to .//TESTCHK > > > > > I'm troubled in this problem for three days. I try to solve this > > > problem,but it still is a puzzle. I think that maybe my ksh script is > > > incorrect or enviroment config configuration need be change. I expect > > > to obtain your help. > > > My operator system is AIX 6.1. > > > > > > ***************************************************************************-********************** > > > ksh script Build6.ksh > > > > > cc -q64 -c Simple.c > > > jcompile -c CTest.c > > > xlc -G -q64 -qmkshrobj -o $JBCDEV_LIB/libshr1.so simple.o ctest.o > > > export LIBPATH=$PWD:$LIBPATH > > > export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH > > > export SHLIB_PATH=$PWD:$SHLIB_PATH > > > jcompile -Qs $JBCDEV_LIB/libdraft.sl -L. -lshr1 VCHKXVERIFYPAYPWD.b > > > > > ========================================================= > > > VCHKXVERIFYPAYPWD.b > > > > > SUBROUTINE VCHKXVERIFYPAYPWD > > > > > DEFC INT ABC(VAR,VAR) > > > > > RETURN.CODE = -1 > > > R.ERROR.MSG = '' > > > > > P1 = "hi test test" > > > > > RETURN.CODE = ABC(P1, R.ERROR.MSG) > > > CRT "RTN.MSG=" :R.ERROR.MSG > > > CRT "RETURN.CODE=" : RETURN.CODE > > > RETURN > > > END > > > > > ========================================================== > > > > > CTest.c > > > > > #include <jsystem.h> > > > #include <assert.h> > > > #include "stdhead.h" > > > #include "simple.h" > > > #define HOME "HOME" > > > > > #ifdef DPSTRUCT_DEF > > > #define JBASEDP DPSTRUCT *dp, > > > #else > > > #define JBASEDP > > > #endif > > > > > INT32 ABC(JBASEDP VAR *param1, VAR *Result) > > > { > > > INT32 ret; > > > char *ptrParam1, *ptrResult; > > > char aResult[11]; > > > ptrParam1 = (char *)CONV_SFB(param1); > > > ptrResult = (char *)CONV_SFB(Result); > > > ret = VerifyPayCodeAAA(ptrParam1, ptrResult); > > > STORE_BBS(Result, ptrResult); > > > return ret; > > > > > } > > > > > ======================================================== > > > source Simple.c > > > > > #include "simple.h" > > > int VerifyPayCodeAAA(unsigned char* pClientPkg,unsigned char* > > > strErrmsg) { > > > char *prtErrmsg; > > > memcpy(strErrmsg, "hello, this is test", 30); > > > STORE_BBS(strErrmsg, prtErrmsg); > > > return 0; > > > } > > > > > ========================================================= > > > source simple.h > > > > > int VerifyPayCodeAAA(unsigned char* pClientPkg,unsigned char* > > > strErrmsg); > > > > > ========================================================== > > > source stdhead.h > > > > > #ifndef _STDHEAD_H_MYCM_DDM_19991014_ > > > #define _STDHEAD_H_MYCM_DDM_19991014_ > > > > > #include <stdio.h> > > > #include <stdlib.h> > > > #include <string.h> > > > #include <memory.h> > > > #include <time.h> > > > //#include <bool.h> > > > #include <errno.h> > > > #include <time.h> > > > #include <signal.h> > > > #include <unistd.h> > > > #include <termio.h> > > > #include <fcntl.h> > > > > > #include <sys/ipc.h> > > > #include <sys/msg.h> > > > #include <sys/sem.h> > > > #include <sys/types.h> > > > #include <sys/socket.h> > > > > > #include <netinet/in.h> > > > #include <arpa/inet.h> > > > > > #ifndef BYTE > > > typedef unsigned char BYTE; > > > #endif > > > > > #ifndef BOOL > > > typedef unsigned char BOOL; > > > #endif > > > > > typedef int SOCKET; > > > typedef unsigned int UINT; > > > typedef unsigned char UCHAR; > > > typedef unsigned short WORD; > > > #endif > > > > > -- > > > -- > > > IMPORTANT: T24/Globus posts are no longer accepted on this forum. > > > > > To post, send email to [email protected] > > > To unsubscribe, send email to [email protected] > > > For more options, visit this group at > > >http://groups.google.com/group/jBASE?hl=en- 隐藏被引用文字 - > > > > - 显示引用的文字 - > > -- > -- > IMPORTANT: T24/Globus posts are no longer accepted on this forum. > > To post, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en > > > > -- -- IMPORTANT: T24/Globus posts are no longer accepted on this forum. To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
