开发者

Does anyone know what causes this error? VC++ with VisualAssert

Hi does anyone know what causes this error? In Visual Studio 2008 with Visual Assert Thanks

 1>------ Build started: Project: ChessRound1, Configuration: Debug Win32 ------
    1>Compiling...
    1>stdafx.cpp
    1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocnum(135) : error C2857: '#include' statement specified with the /Ycstdafx.h command-line 开发者_如何学Pythonoption was not found in the source file
    1>Build log was saved at "file://c:\Users\Admin1\Documents\Visual Studio 2008\Projects\ChessRound1\ChessRound1\Debug\BuildLog.htm"
    1>ChessRound1 - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


This happens because something in your project is configured to use the precompiled headers file but nothing is configured to create it.

Right click the file stdafx.cpp, select properties, go to C/C++, precompiled headers, select "Create precompiled header" in the first edit box.

If you want to disable precompiled headers completely, go to the project properties and select there "Not using precompiled header" and make sure that there aren't any files that override that settings to "Use precompiled header"

Visual assist has nothing to do with it BTW. Infact, visual assist never interferes with compilation.


I just had this error while moving header and source files around. The problem was that in "stdafx.cpp -> Properties -> C/C++ -> Precompiled Headers" the path to "stdafx.h" was still pointing to the old location. When I updated the path to the new location the problem went away.


I had the same error when I added a new CPP file to my VS2008 solution. Got resolved by including following header file in my new CPP file:

#include "StdAfx.h"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜