Menu

Unsatisfied symbol "filename" in file /tmp/cob24767_0.o using cobc (HP-UX)

2020-10-22
2020-10-26
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Hi everyone,

    So after successfully inplementing and making GNUCOBOL thanks to Simon on this forum... I've come accross an error when trying to run this command: (Please see below)
    Any assistance will be greatly appreciatred.....

    /usr/local/bin/cobc -v -x bpay2chk.c CCSVALCN.o CCSGENCD.o CCSINTCN.o BPAY2CALL.o -L/usr/local/lib -lcob -lm -o bpay2chk
    
    Built     Oct 20 2020 19:29:46  Packaged  Oct 17 2020 17:22:09 UTC
    C version (HP aC++/ANSI C) 61500
    loading standard configuration file 'default.conf'
    command line:   /usr/local/bin/cobc -v -x -L/usr/local/lib -lcob -lm -o bpay2chk bpay2chk.c CCSVALCN.o CCSGENCD.o CCSINTCN.o BPAY2CALL.o
    executing:      cc -c +DD64 -Ae -AC99 -D_XOPEN_SOURCE=700 -I/usr/local/include
                    -I/usr/local/include +Olit=all -w -o "/tmp/cob24849_0.o"
                    "bpay2chk.c"
    return status:  0
    executing:      cc -o "bpay2chk" "/tmp/cob24849_0.o" "CCSVALCN.o" "CCSGENCD.o"
                    "CCSINTCN.o" "BPAY2CALL.o" -L/usr/local/lib/hpux64
                    -L/usr/lib/hpux64 -L"/usr/local/lib" -L/usr/local/lib -lcob
                    -lm -l"cob" -l"m"
    ld: Unsatisfied symbol "BPAY2CALL" in file /tmp/cob24849_0.o
    1 error.
    return status:  1
    
     

    Last edit: Simon Sobisch 2020-10-22
    • Simon Sobisch

      Simon Sobisch - 2020-10-22

      As you may see from the output: there's no need to manually specify -I/path/to/libcob.h, -L/path/to/libcob, -lcob or -lm on the command line, cobc knows of this need and adds those where necessary (if you are interested cobc -v always tells you what it does, cobc --info will tell you about the inbuilt defaults that are automatically calculated when running the configure script).

      Concerning the actual error: the linker is instructed to use BPAY2CALL (I guess this is directly referenced in bpay2chk.c and you want to use static C to COBOL. In the case of static calls everything needs to be available at link time and this includes correct casing. C seems to use BPAY2CALL and I'm quite sure that BPAY2CALL.o, presumably from a BPAY2CALL,cob does not provide this entry point. Possibly the PROGRAM-ID has a different casing?

       
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Hi Simon,

    Thanks for the info. I'm not in the position to modify any of the programs listed. Im looking for an alternative to microfocus which works when this command is run (see below). The linker produces the final c routine. Cheers.

    /opt/microfocus/cobol/bin/cob -xU bpay2chk.c BPAY2CALL.o CCSVALCN.o CCSGENCD.o CCSINTCN.o -o bpay2chk

     
    • Simon Sobisch

      Simon Sobisch - 2020-10-22

      There are options to work around this. Is BPAY2CALL a COBOL program? If yes, how does its PROGRAM-ID look like?

       
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Hi Simon,

    Here it is..

           IDENTIFICATION DIVISION.
           PROGRAM-ID.     bpay2call.
          *REMARKS.        FORMAT THE DATA FROM bpay2chk and call CCSINTCN.
          *     SKIP
           ENVIRONMENT DIVISION.
    
     

    Last edit: Simon Sobisch 2020-10-22
    • Simon Sobisch

      Simon Sobisch - 2020-10-22

      In this case adding -ffold-call=UPPER when creating BPAY2CALL .o should be a workaround (but this won't work without additional work if the COBOL programs call C entry points that are in lower-case or even C library functions, to be able to still use those a very small additional wrapper would be needed [one extra CENTRIES.o for the link]).

       
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Hi Simon

    So here is my compile script:

    #!/usr/bin/ksh
    
    /usr/local/bin/cobc   -c CCSVALCN.cbl
    /usr/local/bin/cobc   -c CCSGENCD.cbl
    /usr/local/bin/cobc   -c CCSINTCN.cbl
    /usr/local/bin/cobc --ffold-call=UPPER  -c BPAY2CALL.cbl
    
    /usr/local/bin/cobc -v -x bpay2chk.c CCSVALCN.o CCSGENCD.o CCSINTCN.o BPAY2CALL.o -o bpay2chk
    

    Here is the output now:

    cobc (GnuCOBOL) 3.1-dev.0
    Built     Oct 20 2020 19:29:46  Packaged  Oct 17 2020 17:22:09 UTC
    C version (HP aC++/ANSI C) 61500
    loading standard configuration file 'default.conf'
    command line:   /usr/local/bin/cobc -v -x -o bpay2chk bpay2chk.c CCSVALCN.o CCSGENCD.o CCSINTCN.o BPAY2CALL.o
    executing:      cc -c +DD64 -Ae -AC99 -D_XOPEN_SOURCE=700 -I/usr/local/include
                    -I/usr/local/include +Olit=all -w -o "/tmp/cob29020_0.o"
                    "bpay2chk.c"
    return status:  0
    executing:      cc -o "bpay2chk" "/tmp/cob29020_0.o" "CCSVALCN.o" "CCSGENCD.o"
                    "CCSINTCN.o" "BPAY2CALL.o" -L/usr/local/lib/hpux64
                    -L/usr/lib/hpux64 -L/usr/local/lib -lcob -lm
    return status:  0
    executing:      chatr -s +s enable "bpay2chk" 1>/dev/null 2>&1
    return status:  0
    

    Have known other to get it going in similar environments using:

       cob -cx CCSINTCN.cbl
       cob -cx CCSVALCN.cbl
       cob -cx CCSGENCD.cbl
       cob -cx BPAY2CALL.cbl
    
       if [ "${GCCYES}" = 0 ];then
          cc -Ae bpay2chk.c BPAY2CALL.o CCSVALCN.o CCSGENCD.o CCSINTCN.o -L /opt/cobol/cobdir/coblib -lcobol -lcrtn -lmbcs -lmfo -loops -lscreen -o bpay2chk
       else
          gcc -ansi bpay2chk.c BPAY2CALL.o CCSVALCN.o CCSGENCD.o CCSINTCN.o -L /opt/cobol/cobdir/coblib -l cobol -lcrtn -lmbcs -lmfo -loops -lscreen -o bpay2chk 
       fi
    

    Simon, please note the -cx (x =executable) for first 4 programs.

    When I include the -cx the following errors occur.

    CCSVALCN.cbl:939: error: executable program requested but PROCEDURE/ENTRY has USING clause
    CCSGENCD.cbl:123: error: executable program requested but PROCEDURE/ENTRY has USING clause
    CCSINTCN.cbl:383: error: executable program requested but PROCEDURE/ENTRY has USING clause
    BPAY2CALL.cbl:62: error: executable program requested but PROCEDURE/ENTRY has USING clause
    cobc (GnuCOBOL) 3.1-dev.0
    Built     Oct 20 2020 19:29:46  Packaged  Oct 17 2020 17:22:09 UTC
    C version (HP aC++/ANSI C) 61500
    loading standard configuration file 'default.conf'
    command line:   /usr/local/bin/cobc -v -x -o bpay2chk bpay2chk.c CCSVALCN.o CCSGENCD.o CCSINTCN.o BPAY2CALL.o
    bpay2chk.c: cobc: CCSVALCN.o: No such file or directory
    
     

    Last edit: Simon Sobisch 2020-10-22
  • Simon Sobisch

    Simon Sobisch - 2020-10-22

    I'm not sure about MF's cob compiler driver program, but with cobc you never should ever need to run the compiler itself - just feed cobc with everything and it (very likely ;-) does the correct thing.

    That said cboc -x is for creating a "main" a "system executable file" (so same as MF). Those are used to directly call from the operating system, if you want to link this with other programs then only one of those may include the -x.
    As the main program actually is bpay2chk.c I'd remove all -x from that scrip when converting it from cob to cobc and you should be good to go.

    So I guess this means you've just reached the next step of the conversion test?

    Side note: I've mod-edited your post to include "proper" syntax, please check via "edit" how it is done, allowing you to post even better ;-)

     

    Last edit: Simon Sobisch 2020-10-22
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Hi Simon,

    I tried to use the edit function in my posts but I cannot identify what changes you have made to my posts.

    Thanks
    Mark.

     
    • Simon Sobisch

      Simon Sobisch - 2020-10-22

      I've wrapped single commands / identifiers in backticks ` and pieces of code or shell into a code area (starts and ends with ```) with a language hint.

       
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Brillaint , thanks Simon.

    Can I ask when I run:

    nm bpay2chk - there are a lot of UNDEF strings, looks like I'm im missing libs. What do you think?

    Thanks.

    nm bpay2chk
    
    Symbols from bpay2chk:
    
    [Index]    Value                  Size    Type  Bind  O Shndx    Name
    
    [0]      |                     0|       0|NOTYP|LOCAL|0|   UNDEF|
    [25]     |   6917529027641088120|       0|SECT |LOCAL|0|.HP.init|.HP.init
    [14]     |   4611686018427399592|       0|SECT |LOCAL|0|.HP.opt_annot|.HP.opt_annot
    [26]     |   6917529027641088120|       0|SECT |LOCAL|0|.HP.preinit|.HP.preinit
    [12]     |   4611686018427394088|       0|SECT |LOCAL|0|.IA_64.unwind|.IA_64.unwind
    [11]     |   4611686018427394064|       0|SECT |LOCAL|0|.IA_64.unwind_hdr|.IA_64.unwind_hdr
    [13]     |   4611686018427394544|       0|SECT |LOCAL|0|.IA_64.unwind_info|.IA_64.unwind_info
    [23]     |   4611686018427667520|     736|STUB |LOCAL|0|.bortext|.PLT0
    [22]     |   4611686018427667520|       0|SECT |LOCAL|0|.bortext|.bortext
    [34]     |   6917529027641089488|       0|SECT |LOCAL|0|    .bss|.bss
    [24]     |   6917529027641081856|       0|SECT |LOCAL|0|   .data|.data
    [40]     |                     0|       0|SECT |LOCAL|0|.debug_actual|.debug_actual
    [39]     |                     0|       0|SECT |LOCAL|0|.debug_line|.debug_line
    [41]     |                     0|       0|SECT |LOCAL|0|.debug_procs_abbrev|.debug_procs_abbrev
    [42]     |                     0|       0|SECT |LOCAL|0|.debug_procs_info|.debug_procs_info
    [31]     |   6917529027641088816|       0|SECT |LOCAL|0|    .dlt|.dlt
    [5]      |   4611686018427388808|       0|SECT |LOCAL|0|.dynamic|.dynamic
    [16]     |   4611686018427411592|       0|SECT |LOCAL|0|.dynhash|.dynhash
    [7]      |   4611686018427391112|       0|SECT |LOCAL|0| .dynstr|.dynstr
    [6]      |   4611686018427389240|       0|SECT |LOCAL|0| .dynsym|.dynsym
    [37]     |                     0|       0|SECT |LOCAL|0|.fastbind|.fastbind
    [29]     |   6917529027641088120|       0|SECT |LOCAL|0|.fini_array|.fini_array
    [8]      |   4611686018427392304|       0|SECT |LOCAL|0|   .hash|.hash
    [35]     |   6917529027641094440|       0|SECT |LOCAL|0|   .hbss|.hbss
    [27]     |   6917529027641088120|       0|SECT |LOCAL|0|.init_array|.init_array
    [4]      |   4611686018427388760|       0|SECT |LOCAL|0| .interp|.interp
    [38]     |                     0|       0|SECT |LOCAL|0|   .note|.note
    [3]      |   4611686018427388640|       0|SECT |LOCAL|0|.note.hpux_options|.note.hpux_options
    [17]     |   4611686018427411904|       0|SECT |LOCAL|0|    .opd|.opd
    [30]     |   6917529027641088128|       0|SECT |LOCAL|0|    .plt|.plt
    [28]     |   6917529027641088120|       0|SECT |LOCAL|0|.preinit_array|.preinit_array
    [9]      |   4611686018427392816|       0|SECT |LOCAL|0|.rela.dlt|.rela.dlt
    [10]     |   4611686018427393032|       0|SECT |LOCAL|0|.rela.plt|.rela.plt
    [15]     |   4611686018427400288|       0|SECT |LOCAL|0| .rodata|.rodata
    [33]     |   6917529027641089336|       0|SECT |LOCAL|0|   .sbss|.sbss
    [32]     |   6917529027641089040|       0|SECT |LOCAL|0|  .sdata|.sdata
    [19]     |   4611686018427412704|      32|STUB |LOCAL|0|   .text|.stub
    [20]     |   4611686018427413200|     736|STUB |LOCAL|0|   .text|.stub
    [21]     |   4611686018427607392|     416|STUB |LOCAL|0|   .text|.stub
    [36]     |   6917529027641094440|       0|SECT |LOCAL|0|   .tbss|.tbss
    [18]     |   4611686018427411968|       0|SECT |LOCAL|0|   .text|.text
    [44]     |                     0|       0|FILE |LOCAL|0|     ABS|/tmp/cob616_0.c
    [49]     |                     0|       0|FILE |LOCAL|0|     ABS|/tmp/cob620_0.c
    [53]     |                     0|       0|FILE |LOCAL|0|     ABS|/tmp/cob624_0.c
    [58]     |                     0|       0|FILE |LOCAL|0|     ABS|/tmp/cob628_0.c
    [61]     |                     0|       0|FILE |LOCAL|0|     ABS|/ux/core/libs/libcres/archive_em_64/../gen/em_64/memmove.s
    [111]    |   4611686018427652592|     272|FUNC |GLOB |0|   .text|BPAY2CALL
    [59]     |   4611686018427652864|    5408|FUNC |LOCAL|0|   .text|BPAY2CALL_
    [60]     |   4611686018427658272|     496|FUNC |LOCAL|0|   .text|BPAY2CALL_module_init
    [134]    |   4611686018427608512|     336|FUNC |GLOB |0|   .text|CCSGENCD
    [51]     |   4611686018427608848|   14736|FUNC |LOCAL|0|   .text|CCSGENCD_
    [52]     |   4611686018427623584|     496|FUNC |LOCAL|0|   .text|CCSGENCD_module_init
    [112]    |   4611686018427624560|     528|FUNC |GLOB |0|   .text|CCSINTCN
    [56]     |   4611686018427625088|   27008|FUNC |LOCAL|0|   .text|CCSINTCN_
    [57]     |   4611686018427652096|     496|FUNC |LOCAL|0|   .text|CCSINTCN_module_init
    [117]    |   4611686018427412736|     464|FUNC |GLOB |0|   .text|CCSVALCN
    [47]     |   4611686018427413936|  193456|FUNC |LOCAL|0|   .text|CCSVALCN_
    [48]     |   4611686018427607808|     496|FUNC |LOCAL|0|   .text|CCSVALCN_module_init
    [118]    |   4611686018427388808|       0|OBJT |GLOB |0|.dynamic|_DYNAMIC
    [135]    |                    63|       0|NOTYP|GLOB |0|     ABS|_FPU_STATUS
    [98]     |                     0|       0|NOTYP|GLOB |0|     ABS|__SYSTEM_ID
    [119]    |                     0|       0|NOTYP|GLOB |0|     ABS|__TLS_INIT_A
    [97]     |                     0|       0|NOTYP|GLOB |0|     ABS|__TLS_INIT_SIZE
    [95]     |                     0|       0|NOTYP|GLOB |0|     ABS|__TLS_INIT_START
    [70]     |                     0|       0|NOTYP|GLOB |0|     ABS|__TLS_PREALLOC_DTV_A
    [110]    |                     0|       0|NOTYP|GLOB |0|     ABS|__TLS_SIZE
    [105]    |   4611686018428956448|       0|FUNC |GLOB |0|   UNDEF|___exit
    [125]    |   6917529027641081856|       0|NOTYP|GLOB |0|   .data|__data_start
    [93]     |   6917529027641088120|       0|NOTYP|GLOB |0|.fini_array|__fini_end
    [129]    |   6917529027641088120|       0|NOTYP|GLOB |0|.fini_array|__fini_start
    [115]    |   6917529027641088808|       0|NOTYP|GLOB |0|   .sbss|__gp
    [99]     |   6917529027641088120|       0|NOTYP|GLOB |0|.HP.preinit|__hp_preinit_end
    [87]     |   6917529027641088120|       0|NOTYP|GLOB |0|.HP.preinit|__hp_preinit_start
    [64]     |   6917529027641088120|       0|NOTYP|GLOB |0|.init_array|__init_end
    [84]     |   6917529027641088120|       0|NOTYP|GLOB |0|.init_array|__init_start
    [122]    |                     0|       0|NOTYP|GLOB |0|   UNDEF|__memmove_ver
    [1]      |   4611686018427658784|    8736|FUNC |LOCAL|0|   .text|__milli_memcpy
    [2]      |   4611686018427658784|    8736|FUNC |LOCAL|0|   .text|__milli_memmove
    [96]     |                    16|       0|NOTYP|GLOB |0|     ABS|__profil_size
    [62]     |   4611686018427387904|       0|NOTYP|GLOB |0|.note.hpux_options|__text_start
    [101]    |   4611686018427387904|       0|FUNC |GLOB |0|.note.hpux_options|__text_start_f
    [124]    |   4611686018427394064|       0|NOTYP|GLOB |0|.IA_64.unwind_hdr|__unwind_header
    [133]    |   6917529027641089336|       0|NOTYP|GLOB |0|  .sdata|_edata
    [116]    |   6917529027641094440|       0|NOTYP|GLOB |0|     ABS|_end
    [85]     |   4611686018427668256|       0|NOTYP|GLOB |0|.bortext|_etext
    [92]     |   4611686018427668256|       0|FUNC |GLOB |0|.bortext|_etext_f
    [68]     |   4611686018428115744|       0|FUNC |GLOB |0|   UNDEF|_memcmp
    [67]     |   4611686018428117536|       0|FUNC |GLOB |0|   UNDEF|_memcpy
    [73]     |   4611686018428126144|       0|FUNC |GLOB |0|   UNDEF|_memset
    [43]     |                     0|       0|FILE |LOCAL|0|     ABS|bpay2chk.c
    [74]     |   4611686018427871952|       0|FUNC |GLOB |0|   UNDEF|cob_add
    [63]     |   4611686018427876480|       0|FUNC |GLOB |0|   UNDEF|cob_add_int
    [72]     |   4611686018427632800|       0|FUNC |GLOB |0|   UNDEF|cob_check_version
    [75]     |   4611686018427640768|       0|FUNC |GLOB |0|   UNDEF|cob_cmp
    [102]    |   4611686018427884544|       0|FUNC |GLOB |0|   UNDEF|cob_cmp_numdisp
    [46]     |   4611686018427412432|     272|FUNC |LOCAL|0|   .text|cob_cmp_s16
    [55]     |   4611686018427624288|     272|FUNC |LOCAL|0|   .text|cob_cmp_s16
    [80]     |   4611686018427870080|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_add
    [104]    |   4611686018427885984|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_alloc
    [132]    |   4611686018427841856|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_clear
    [82]     |   4611686018427871248|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_cmp
    [81]     |   4611686018427870720|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_div
    [78]     |   4611686018427863264|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_get_field
    [88]     |   4611686018427841728|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_init
    [83]     |   4611686018427870528|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_mul
    [69]     |   4611686018427865888|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_set_field
    [131]    |   4611686018427842112|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_set_llint
    [86]     |   4611686018427870304|       0|FUNC |GLOB |0|   UNDEF|cob_decimal_sub
    [89]     |   4611686018427874816|       0|FUNC |GLOB |0|   UNDEF|cob_div_quotient
    [120]    |   4611686018427875712|       0|FUNC |GLOB |0|   UNDEF|cob_div_remainder
    [79]     |   4611686018427605024|       0|FUNC |GLOB |0|   UNDEF|cob_fatal_error
    [108]    |   4611686018427624544|       0|FUNC |GLOB |0|   UNDEF|cob_get_global_ptr
    [65]     |   4611686018427820128|       0|FUNC |GLOB |0|   UNDEF|cob_get_int
    [128]    |   4611686018427820960|       0|FUNC |GLOB |0|   UNDEF|cob_get_llint
    [45]     |   4611686018427412224|     208|FUNC |LOCAL|0|   .text|cob_get_numdisp
    [50]     |   4611686018427608304|     208|FUNC |LOCAL|0|   .text|cob_get_numdisp
    [54]     |   4611686018427624080|     208|FUNC |LOCAL|0|   .text|cob_get_numdisp
    [94]     |   4611686018427893824|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_before
    [66]     |   4611686018427894448|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_characters
    [100]    |   4611686018427899328|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_finish
    [126]    |   4611686018427892896|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_init
    [76]     |   4611686018427896192|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_leading
    [121]    |   4611686018427893760|       0|FUNC |GLOB |0|   UNDEF|cob_inspect_start
    [106]    |   4611686018427642112|       0|FUNC |GLOB |0|   UNDEF|cob_is_numeric
    [107]    |   4611686018427629632|       0|FUNC |GLOB |0|   UNDEF|cob_module_free
    [90]     |   4611686018427624640|       0|FUNC |GLOB |0|   UNDEF|cob_module_global_enter
    [103]    |   4611686018427629568|       0|FUNC |GLOB |0|   UNDEF|cob_module_leave
    [113]    |   4611686018427808192|       0|FUNC |GLOB |0|   UNDEF|cob_move
    [114]    |   4611686018428049872|       0|FUNC |GLOB |0|   UNDEF|cob_resolve_cobol
    [123]    |   4611686018428046048|       0|FUNC |GLOB |0|   UNDEF|cob_set_cancel
    [77]     |   4611686018427872784|       0|FUNC |GLOB |0|   UNDEF|cob_sub
    [109]    |   4611686018427877376|       0|FUNC |GLOB |0|   UNDEF|cob_sub_int
    [127]    |   4611686018427411968|     256|FUNC |GLOB |0|   .text|main
    [71]     |   4611686018428117536|       0|FUNC |WEAK |0|   UNDEF|memmove
    [91]     |   4611686018429722144|       0|FUNC |WEAK |0|   UNDEF|printf
    [130]    |   4611686018428131744|       0|FUNC |WEAK |0|   UNDEF|strcpy
    
     

    Last edit: Simon Sobisch 2020-10-22
    • Simon Sobisch

      Simon Sobisch - 2020-10-22

      Those undefined entries are parts of either libcob or your libc. As the link loader should load both when the executable is run I think all is fine. Use ldd bpay2chkto check if all libraries referenced in the executable can be resolved.
      If it can't and only libcob is an issue you possibly want to either add a linker realpath hint (what works and the way it needs to be specified is system dependent, could only look for online docs if/how to do this on hpux with the neative compiler/linker) or add /usr/local/lib to LD_LIBRARY_PATH.

       

      Last edit: Simon Sobisch 2020-10-22
  • Mark Di Donato

    Mark Di Donato - 2020-10-22

    Yep, they can.

    however with: ldd -v bpay2chk I get this result:

    ldd -v bpay2chk

    bpay2chk:

    find library=libcob.so.4; required by bpay2chk
    libcob.so.4 => /usr/local/lib/hpux64/libcob.so.4

    find library=libm.so.1; required by bpay2chk
    libm.so.1 => /usr/lib/hpux64/libm.so.1

    find library=libc.so.1; required by bpay2chk
    libc.so.1 => /usr/lib/hpux64/libc.so.1

    find library=libm.so.1; required by /usr/local/lib/hpux64/libcob.so.4
    libm.so.1 => /usr/lib/hpux64/libm.so.1

    find library=/usr/local/lib/hpux64/libgmp.so; required by /usr/local/lib/hpux64/libcob.so.4
    /usr/local/lib/hpux64/libgmp.so => /usr/local/lib/hpux64/libgmp.so
    ** '/usr/local/lib/hpux64/libgmp.so' is not a valid load module: Bad magic number**

     

    Last edit: Mark Di Donato 2020-10-22
  • Mark Di Donato

    Mark Di Donato - 2020-10-26

    Hi Simon,

    Thanks for your help, I've resolved the Bad magic number error.... but when, I tested the program and I now receive the following erorr:

    libcob: error: cob_init() has not been called

    Is this this an issue with my environment setup/initialisation (at run time).

    Thanks Simon
    regards,
    Mark.

     

    Last edit: Mark Di Donato 2020-10-26
    • Simon Sobisch

      Simon Sobisch - 2020-10-26

      I've missed the "bad magic number part" before (guess it was post edited and I personally read the posts mainly via mail subscription) - How did you resolved it?

       
      • Mark Di Donato

        Mark Di Donato - 2020-10-26

        My bad here, accidently cleared the library... I had a backup... :)

         
  • Mark Di Donato

    Mark Di Donato - 2020-10-26

    Hi Simon,

    Managed to solve the; libcob: error: cob_init() has not been called error
    by adding the -fimplicit-init option to tmy cobc statements.

    Fantastic Stuff!

    Thanks
    Mark.

     
    • Simon Sobisch

      Simon Sobisch - 2020-10-26

      Yes, -fimplicit-init works around that. ut of interest: did you found that in the manual (HTML version linked above, but also shipped as PDF under "docs"), directly in the cobc --help or somewhere else?
      Note: that option has not have any side-effect in 3.1 (it had it before, pimarily a minimal less startup time), the main reason that -fimplicit-init isn't implied is that by using this option COBOL modules won't have access to the command line (which you can also prohibit when explicit initializing the runtime) and that you must have an explicit STOP RUN in the COBOL modules, otherwise the runtime won't ever get a clear tear-down.
      If you do that - no problem (but it won't allow the "C" part to do anyything after COBOL), otherwise I suggest to recheck if it would be possible to explicit initialize the runtime before the first COBOL invokation via cob_init and after COBOL has done its work tear it down via cob_tidy. The same would be true for MF-compilers (and libcob.h defines wrappers for the MF variant cobinit/cobtidy). You can do this in every part of the "C" side and also re-initialize to cleanly separate the COBOL parts, if that's reasonable (initializing and tear-down takes some cpu-cycles of course, so you likely don't want to do that 100times per minute).

       
  • Mark Di Donato

    Mark Di Donato - 2020-10-26

    Hi

    Yes, cobc --help makes mention of -fimplicit-init
    Looking for another way to intitalise runtime without modifing code, is it possible to do this with an environment variable. Settings so far include:

    SHLIB_PATH=/usr/local/lib/hpux64:/usr/lib/hpux64
    LD_LIBRARY_PATH=/usr/local/lib/hpux64:/usr/lib/hpux64
    COB_LIBRARY_PATH=/usr/local/lib

    Cheers.

     
    • Simon Sobisch

      Simon Sobisch - 2020-10-26

      No, that way you'd just have the minimal implicit init and you'd still have no explicit tear-down.
      As mentioned: this is no issue as long as you don't need access to the command line options form COBOL, there's a guaranteed STOP RUN in the COBOL code called and there's nothing to do after the first call of a COBOL entry from C.

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.