Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 option 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 ==========
like image 791
TerryJohnson Avatar asked Apr 21 '10 07:04

TerryJohnson


3 Answers

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.

like image 166
shoosh Avatar answered Nov 11 '22 16:11

shoosh


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.

like image 38
Sogartar Avatar answered Nov 11 '22 14:11

Sogartar


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"
like image 1
user3405291 Avatar answered Nov 11 '22 16:11

user3405291