C/C++

C/C++

C/C++

Your one-stop destination to learn and collaborate about the latest innovations in IBM C/C++ for z/OS compilers to develop high-performing C/C++ applications and system programs on z/OS while maximizing hardware use and improving application performance.

 View Only
Expand all | Collapse all

Compiling and creating a DLL for 64 bit using c89 and lp64 option

  • 1.  Compiling and creating a DLL for 64 bit using c89 and lp64 option

    Posted Fri April 24, 2015 03:37 PM

    Hi ,

    I am trying out a JNI program (Java calling a COBOL progam using c- as glue layer) in z/OS. The program works well in 31 bit but when the tried in 64 bit it fails even after compiling and creating a dll using LP64 option . Below are the details of commands that are being used. Please help.

    -- C- Compilation ---

    c89 -c -o test.o -W "c,langlvl(extended)",lp64 -W c,expo,lp64,dll -DNEEDSIEE754 -DNEEDSLONGLONG -I/nonsp/java/current7_64/include test.c  --- This compiles without any errors.

    Next step is building the DLL--- The dll comprises the compile c file and a COBOL program in MVS data set.

    c89 -Wl,lp64,dll -o libMyLib.so test.o "//'XX10.CBL.OBJECT.OBJ(TESTCOB)'"

     ----- In this step I get the below errors --

     IEW2480W A711 EXTERNAL SYMBOL CEELLIST OF TYPE LD WAS ALREADY DEFINED AS A     
              SYMBOL OF TYPE LD IN SECTION CEEBLLST.                                
     IEW2482W A712 THE ORIGINAL DEFINITION WAS IN A MODULE IDENTIFIED BY DDNAME     
              C8921.  THE DUPLICATE DEFINITION IS IN SECTION CELQLLST  IN A MODULE  
              IDENTIFIED BY DDNAME SYSLIB.                                          
     IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO MYCOB1 FROM SECTION test#C DO
              NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2              
     IEW2469E 9907 THE ATTRIBUTES OF A REFERENCE TO TESTCOB FROM SECTION test#C DO
              NOT MATCH THE ATTRIBUTES OF THE TARGET SYMBOL. REASON  2              
    FSUM3065 The LINKEDIT step ended with return code 8.                            
    ------------------------------------------------------------------------------------------------------

     

    Same compile options by removing lp64 , it works for 31 bit mode without any issues.

     

    Appreciate any help.

     

    Thanks,

     

     

     

     

     

     

    pathi7


  • 2.  Re: Compiling and creating a DLL for 64 bit using c89 and lp64 option

    Posted Tue May 26, 2015 11:48 AM

    Hi,

    31bit and 64bit cannot be mixed. The COBOL program is in 31bit. It cannot be linked with the C code in 64bit.

    Thanks.
    Regards,
    Raymond Mak

    raym