FIX: Two #ident or #pragma Comment Statements May Cause L5000

Last reviewed: September 16, 1997
Article ID: Q104647
1.00 WINDOWS kbtool kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft C/C++ Compiler (CL.EXE), included with:

        - Microsoft Visual C++ for Windows, versions 1.0
    

SYMPTOMS

When using two #ident preprocessor directives or #pragma comments to insert two comments into an executable file, the linker generates an L5000 error when the second comment is longer than 20 characters.

RESOLUTION

There are a three workarounds:

  • Make the second comment shorter than 20 characters.

    -or-

- Compile with the optimizing compiler (/f-).

  -or-

  • Instead of using a #ident or #pragma comment, declare a literal character string in your application:

          char trademark[50]="Your trademarked name goes here"
    

    This will make the phrase "Your trademarked name goes here" appear in the executable file as well.

    STATUS

    Microsoft has confirmed this to be a problem in the Microsoft products listed above. This is not a problem in Visual C++, 32-bit Edition. This problem was corrected in Visual C++ for Windows, version 1.0.

    MORE INFORMATION

    The comments #ident "This is a comment" and #pragma comment(exestr,"This is a comment") both place the phrase "This is a comment" into the executable file. This comment can be seen when the .EXE file is viewed within an editor, and is often used for copyright protection.

    The first line can be longer than 20 characters and not generate the L5000 error.

    Sample Code

    /* Compile options needed: /f- to fix problem
    */
    
    
    #ident "a" #ident "now is the time for a"

    void main(void)
    
    { }


  • Additional reference words: 1.00 8.00
    KBCategory: kbtool kbfixlist kbbuglist
    KBSubcategory: CLIss
    Keywords : CLIss kb16bitonly kbbuglist kbfixlist kbtool
    Version : 1.00
    Platform : WINDOWS
    Solution Type : kbfix


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: September 16, 1997
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.