Menu

Linker warning: LINK : warning LNK4044: unrecognized option '/LIBRARY:C:\GNU Cobol 2.0\lib'; ignored

2014-09-12
2014-09-15
  • Tony Girgenti

    Tony Girgenti - 2014-09-12

    Hello,

    I'm using GNU Cobol 2.0 in Windows 7/Windows 8.1.

    Whenever I compile a program using "cobc -x -v" without errors, it always gives this warning:

    LINK : warning LNK4044: unrecognized option '/LIBRARY:C:\GNU Cobol 2.0\lib'; ignored
    

    Here is the complete output of one compile:

    C:\GNU COBOL 2.0\Projects\CallCSLibrary>cobc -x -v callcsl.cob cppclibrary.lib
    Command line:   cobc -x -v callcsl.cob cppclibrary.lib
    Preprocessing:  callcsl.cob -> C:\Users\Tony\AppData\Local\Temp\cob35868_0.cob
    Return status:  0
    Parsing:        C:\Users\Tony\AppData\Local\Temp\cob35868_0.cob (callcsl.cob)
    Return status:  0
    Translating:    C:\Users\Tony\AppData\Local\Temp\cob35868_0.cob -> C:\Users\Tony\AppData\Local\Temp\cob35868_0.c (callcsl.cob)
    Executing:      cl /c -I "C:\GNU Cobol 2.0\include" /MD
                    /Fo"C:\Users\Tony\AppData\Local\Temp\cob35868_0.obj"
                    "C:\Users\Tony\AppData\Local\Temp\cob35868_0.c"
    Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    cob35868_0.c
    Executing:      cl /MD /Fe"callcsl"
                    "C:\Users\Tony\AppData\Local\Temp\cob35868_0.obj"
                    "cppclibrary.lib" libcob.lib /link /manifest /LIBPATH:"C:\GNU
                    Cobol 2.0\lib" /LIBRARY:"C:\GNU Cobol 2.0\lib"
    Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    Microsoft (R) Incremental Linker Version 12.00.21005.1
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:callcsl.exe
    /manifest
    "/LIBPATH:C:\GNU Cobol 2.0\lib"
    "/LIBRARY:C:\GNU Cobol 2.0\lib"
    C:\Users\Tony\AppData\Local\Temp\cob35868_0.obj
    cppclibrary.lib
    libcob.lib
    LINK : warning LNK4044: unrecognized option '/LIBRARY:C:\GNU Cobol 2.0\lib'; ignored
    Executing:      mt /manifest "callcsl.exe.manifest"
                    /outputresource:"callcsl.exe";#1
    Microsoft (R) Manifest Tool version 6.3.9600.16384
    Copyright (c) Microsoft Corporation 2012.
    All rights reserved.
    
    C:\GNU COBOL 2.0\Projects\CallCSLibrary>
    

    Here are my environment variables:

    COB_CONFIG_DIR=C:\GNU Cobol 2.0\config
    COB_COPY_DIR=C:\GNU Cobol 2.0\copy
    COB_LIBRARY_PATH=C:\GNU Cobol 2.0\bin
    COB_LIB_PATHS=/LIBRARY:"C:\GNU Cobol 2.0\lib"
    COB_MAIN_DIR=C:\GNU Cobol 2.0\bin
    COB_SCREEN_ESC=Y
    COB_SCREEN_EXCEPTIONS=Y
    

    This is in my "Path:" environment variable:

    C:\GNU Cobol 2.0\Projects\CallCSLibrary;C:\;C:\GNU Cobol 2.0\bin;C:\GNU Cobol 2.0\lib
    

    Any help would gratefully appreciated.

    PS: I'm not sure of why sometimes wrapping lines in "~~~~~~" lines works and sometimes it doesn't.

    Thanks,
    Tony

     

    Last edit: Brian Tiffin 2014-09-12
    • Brian Tiffin

      Brian Tiffin - 2014-09-12

      PS: I'm not sure of why sometimes wrapping lines in "~~~~~~" lines works and sometimes it doesn't.

      There needs to be a blank line before the initial set of squigglies. I get tripped up on this, usually trying to preface the highlighted block with a filename, so it's how I know. ;-)

      Edited the above post to reflect. The closing set of squigglies do not need blanks before or after, but the opening set needs a blank line before.

      Cheers,
      Brian

       

      Last edit: Brian Tiffin 2014-09-12
  • Tony Girgenti

    Tony Girgenti - 2014-09-12

    Thanks Brian.

    Is there a better set of instructions on how to format posts here on SourceForge?

    I have a hard time trying to figure out how to insert an image.

    Thanks,
    Tony

     
    • Brian Tiffin

      Brian Tiffin - 2014-09-13

      Made a new thread, Tony. http://sourceforge.net/p/open-cobol/discussion/help/thread/6149198b/#5684 SourceForge discussion text markup

      Cheers,
      Brian

       
  • Tony Girgenti

    Tony Girgenti - 2014-09-13

    Does anybody have any information about the linker warning?

    Thanks,
    Tony

     
  • Simon Sobisch

    Simon Sobisch - 2014-09-14

    I'm unsure why you have /LIBRARY set via environment in COB_LIB_PATHS - there is no /LIBRARY option in link.exe (which is called by cl.exe you use). You need /LIBPATH which is already in (likely from compiling GC [defaults.h]), therefore just remove the unnecessary /LIBRARY option and there will be no warning.

    Simon

     
  • Tony Girgenti

    Tony Girgenti - 2014-09-15

    I'm sorry Simon.

    I must have put in wrong when I added it to the environment variables.

    Thanks,
    Tony

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB