Home > Cannot Open > Cannot Open Include File: 'stdafx.h': No Such File Or Directory

Cannot Open Include File: 'stdafx.h': No Such File Or Directory

Contents

Linux questions C# questions ASP.NET questions fabric questions SQL questions discussionsforums All Message Boards... How to make plots 'blacker'? If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. asked 5 years ago viewed 18499 times active 5 years ago Get the weekly newsletter! have a peek here

share|improve this answer answered Oct 12 '14 at 22:05 user3718058 788 add a comment| up vote 3 down vote There are two solutions for it. File + New + Project, Visual C++, Win32, select "Win32 Console Application". Understand that English isn't everyone's first language so be lenient of bad spelling and grammar. Cause As the error message says, the compiler is finding an include statement for the header file "stdafx.h", but can't find the file itself. http://stackoverflow.com/questions/6203266/cannot-open-source-file-stdafx-h

Cannot Open Include File: 'stdafx.h': No Such File Or Directory

Browse other questions tagged c++ c or ask your own question. How to use namedpipe as temporary file? I changed one method signature and broke 25,000 other classes. Are you sure that all the paths are properly set up? –Bart Mar 17 '12 at 21:31 add a comment| 1 Answer 1 active oldest votes up vote 16 down vote

Secondly: it's inadvisable to include the precompiled header in your own headers, to not clutter namespace of other source that can use your code as a library, so completely remove its How is it packed? Anyone know what it is? Stdafx.h No Such File Or Directory Linux Then, precompiled header is usually a per-project file in Visual Studio world, so: Ensure you have the file "stdafx.h" in your project.

What is the total sum of the cardinalities of all subsets of a set? Test project can't find implementation of declared constructor? you removed it) just create a new temporary project and copy the default one from there; Change the #include to #include "stdafx.h". http://stackoverflow.com/questions/6203266/cannot-open-source-file-stdafx-h Visit our UserVoice Page to submit and vote on ideas!

share|improve this answer answered Mar 24 '14 at 22:37 Andy 1,181312 1 c) need int main() –Bryan Chen Mar 24 '14 at 22:41 ^yea I got that before Visual Studio Stdafx.h Not Found That's when a library uses stdafx.h, but the program using it does not, and the stdafx.h file is not exposed by the library. –peci1 Jun 11 at 0:27 1 Yes. They use Visual Studio to program their code and because I am using a macbook, I just use vi and terminal (or should I use something else?) Here's the helloworld.cpp program Solution 1 Accept Solution Reject Solution Does the file stdafx.h exists in the same folder where your cpp file is located?

Cannot Open Source File Stdafx.h Visual Studio 2015

I had problems where only one file (from 3rd party) used it, so I had to include it in all my header files. Saturday, October 16, 2010 9:12 AM Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. Cannot Open Include File: 'stdafx.h': No Such File Or Directory asked 2 years ago viewed 11416 times active 2 years ago Get the weekly newsletter! Cannot Open Source File Stdafx H Visual Studio 2013 Using Protecting Strike to grant temporary hitpoints outside of an encounter?

How to use namedpipe as temporary file? navigate here I know since I got it working, It shouldn't matter, but its bugging me and I have a feeling it might trip me up later if I don't know. How can I declare sovereignty from the American government and start my own micro nation? You can fix this problem by adding "$(ProjectDir)" (or wherever the stdafx.h is) to list of directories under Project->Properties->Configuration Propertes->C/C++->General->Additional Include Directories. Cannot Open Source File 'stdafx.cpp' No Such File Or Directory

Subscribed! Errors when running CUDA with OpenCv Include File is present but again showing fatal error C1083: Cannot open include file error when try to include atlrx.h error LNK1104: cannot open file Mar 30, 2011 at 6:32pm UTC scibat (2) I guess I'll figure out when I need it and when I don't later on as I learn. Check This Out In your case, as you probably started from a template project, it was used to include Windows.h only for the _TCHAR macro.

up vote 1 down vote Two problems: a) stdafx.h is not needed (as others noted). Stdafx.h Download My manager said I spend too much time on Stack Exchange. Why do I never get a mention at work?

I was puzzled for quite some time, when I encountered this error for I found no reasonable explanation!

Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Cannot find or open PDB file0error LNK1104: cannot open file 'libeay32.lib' Hot Network Questions Could I work as a Professor in Europe if I only speak English? If you have it, then you must compile 'stdafx.cpp' before compiling anything else. Where Is Stdafx.h Located What exactly are sleeping stalls versus waiting-rooms for airport layovers?

When I #include "GameEngine.h" it gives me the error that it cannot open the source file. Join them; it only takes a minute: Sign up ERROR: Cannot open source file “ ” up vote 10 down vote favorite 1 I am running visual studio C++ and I share|improve this answer answered Jun 1 '11 at 15:01 Vlad 26.9k243122 5 And if you include it, then you have to include it FIRST in every compilation unit. this contact form How to NOT render a part of a document I just saw this bird outside my apartment.