Menu

ld.exe cannot find -lfcgi on windows 10

Anonymous
2021-06-17
2021-06-21
  • Anonymous

    Anonymous - 2021-06-17

    I am trying to get fast cfi working with GnuCOBOL on Windows 10 and seem to be missing fcgi.
    When doing cobc -x xxx.c -lfcgi after mocifying the c code to replace stdio.h with fcgi_stdio.h receive the following error:
    ld.exe cannot find -lfcgi
    Could someone be able to point me to where I can obtain it and where it should be installed.
    Thanks,
    Dave Lumley

     
    • Simon Sobisch

      Simon Sobisch - 2021-06-17

      As this information is missing: what version of GnuCOBOL do you use (cobc --info)?

       
  • Dave Lumley

    Dave Lumley - 2021-06-17

    Window build from Arnold Trembley site

    C:\Users\dluml\Desktop\GNU_COBOL>cobc -v
    cobc (GnuCOBOL) 3.1.2.0
    Built Dec 26 2020 17:29:20 Packaged Dec 23 2020 12:04:58 UTC
    C version (MinGW) "6.3.0"
    loading standard configuration file 'default.conf'

     
  • Dave Lumley

    Dave Lumley - 2021-06-17

    C:\Users\dluml\Desktop\GNU_COBOL>cobc --info
    cobc (GnuCOBOL) 3.1.2.0
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built Dec 26 2020 17:29:20
    Packaged Dec 23 2020 12:04:58 UTC
    C version (MinGW) "6.3.0"

    build information
    build environment : i686-pc-mingw32
    CC : gcc
    C version : (MinGW) "6.3.0"
    CPPFLAGS : -DCHTYPE_64 -DPDC_DLL_BUILD
    -Dinitscr=initscr_x64 -I/mingw/include
    CFLAGS : -O2 -pipe -finline-functions -fsigned-char
    -Wall -Wwrite-strings -Wmissing-prototypes
    -Wno-format-y2k
    LD : c:/mingw/mingw32/bin/ld.exe
    LDFLAGS :

    GnuCOBOL information
    COB_CC : gcc
    COB_CFLAGS : -pipe -DCHTYPE_64 -DPDC_DLL_BUILD
    -Dinitscr=initscr_x64 -I/mingw/include
    -I/mingw/include -Wno-unused -fsigned-char
    -Wno-pointer-sign
    env: COB_CFLAGS : -I"C:\Users\dluml\Desktop\GNU_COBOL\include"
    COB_DEBUG_FLAGS : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS :
    env: COB_LDFLAGS : -L"C:\Users\dluml\Desktop\GNU_COBOL\lib"
    COB_LIBS : -L/mingw/lib -lcob -lm
    COB_CONFIG_DIR : /mingw/share/gnucobol/config
    env: COB_CONFIG_DIR : C:\Users\dluml\Desktop\GNU_COBOL\config
    COB_COPY_DIR : /mingw/share/gnucobol/copy
    env: COB_COPY_DIR : C:\Users\dluml\Desktop\GNU_COBOL\copy
    COB_MSG_FORMAT : GCC
    COB_OBJECT_EXT : o
    COB_MODULE_EXT : dll
    COB_EXE_EXT : .exe
    64bit-mode : no
    BINARY-C-LONG : 4 bytes
    endianness : little-endian
    native EBCDIC : no
    extended screen I/O : pdcurses
    variable file format : 0
    sequential file handler : built-in
    indexed file handler : VBISAM
    mathematical library : GMP
    XML library : disabled
    JSON library : cjson

     
  • Simon Sobisch

    Simon Sobisch - 2021-06-21

    It can't find it, because there is no fastcgi library laying around somewhere.

    I have not checked if that works but I guess the following possibly works on a 32bit MinGW like yours [for 64bit at least the config file has to be adjusted]):

    pushd X:\path\to\fastcgi\include
    copy fcgi_config_x86.h fcgi_config.h
    cd ..\libfcgi
    gcc -I ..\include -shared -o libfcgi.dll -lws2_32 -Wl,--out-implib,libefcgi.dll.a fcgi_stdio.c fcgiapp.c os_win32.c
    :: if the above did not created an error
    cd ..
    copy include\fcgi_stdio.h  %COB_MAIN_DIR%include\
    copy include\fcgiapp.h     %COB_MAIN_DIR%include\
    copy libfcgi\libfcgi.dll   %COB_MAIN_DIR%bin\
    copy libfcgi\libfcgi.dll.a %COB_MAIN_DIR%lib\
    

    Note: in any case you should not need to post-change the C source, instead let cobc (actually the called gcc) "logically" insert it by use cobc -x program.cob -A '--include fcgi_stdio.h' -lfcgi

     

Anonymous
Anonymous

Add attachments
Cancel