BUG: 'CXX0017: Error: symbol not found' Compiling with /Zi

Last reviewed: July 22, 1997
Article ID: Q115709
1.00 1.50 WINDOWS kbtool 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 and 1.5
    

SYMPTOMS

Attempting to use the CodeView Display Expression command (?) when debugging code which was compiled with the /Zi switch may cause CodeView to generate the following error message:

   CXX0017: Error: symbol not found

CAUSE

The compiler is not emitting the correct symbolic information for the symbol.

RESOLUTION

You can sometimes avoid the problem by compiling with the /Z7 switch.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed above. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The sample code shown below can be used to illustrate the problem. To reproduce the problem, do the following:

  1. Compile the sample code with the /Od and /Zi switches.

  2. Load the resulting executable into CodeView.

  3. Set a breakpoint on the final closing } of the source code.

  4. Run to the breakpoint.

  5. Open the Command window in CodeView and enter the following command:

    ?Function( x.a == 1 && ::X() == 5 ),s

  6. Press enter.

This should cause CodeView to call Function() with the result of the expression ( x.a == 1 && ::X() == 5 ) as an argument. The value returned by Function() should be displayed as a string. However, CodeView instead issues the CXX0017 error message.

Compiling the same code with /Od /Z7 and following steps 2 through 6 listed above causes CodeView to correctly display the string "PASSED" as the return from Function().

Sample Code

/* Compile options needed: /Od /Zi
*/

char * Function( int Condition );

int X(void) { return 5; }

void main( void )
{
    struct X { int a; };
    X x;
    x.a = 1;

    {
        struct X { int b; };
        X y;
        y.b = 2;
    }
}

char * Function( int Condition )
{
    if( Condition )
        return "PASSED";
    else
        return "FAILED";
}


Additional reference words: 1.00 1.50 4.10 8.00 8.00c
KBCategory: kbtool kbbuglist
KBSubcategory: CLIss
Keywords : kb16bitonly


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.