Error C1083 Stdafx.h No Such File Or Directory
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta fatal error c1083 no such file or directory Discuss the workings and policies of this site About Us Learn
Error C1083 Cannot Open Include File No Such File Or Directory
more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us fatal error c1083 cannot open source file no such file or directory Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, stdafx.h no such file or directory linux helping each other. Join them; it only takes a minute: Sign up Error C1083: Cannot open include file: 'stdafx.h' up vote 5 down vote favorite When I compiled this program (from Programmin Launguage 4th edition): main.cpp #include
How To Include Stdafx.h In Visual Studio
sqrt_sum(v); return 0; } double sqrt_sum(vector& v) { double sum = 0; for (int i = 0; i != v.size(); ++i) sum += sqrt(v[i]); return sum; } vector.cpp #include
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site cannot open source file stdafx h visual studio 2013 About Us Learn more about Stack Overflow the company Business Learn more about cannot open source file 'stdafx.cpp' no such file or directory hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join
Rpc.h: No Such File Or Directory
the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: 'stdafx.h' file http://stackoverflow.com/questions/26330178/error-c1083-cannot-open-include-file-stdafx-h not found up vote 2 down vote favorite I am new to programming C++ and am trying to learn myself through websites (learncpp.com) although I am already stuck on compiling my first program =( . 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 http://stackoverflow.com/questions/22621928/fatal-error-stdafx-h-file-not-found program I wrote based on the tutorial: #include "stdafx.h" #include tutorial I hit a snag. In the tutorial 0.6 it clearly states: Important note to Visual Studio http://www.cplusplus.com/forum/beginner/39659/ users: Visual studio programs should ALWAYS begin with the following line: #include "stdafx.h" When I do that on the Hello World program I get the following error: Code: 1
2
3
4
5
6
7
8
9
10
11
1>Build started 3/29/2011 2:18:18 PM. 1>InitializeBuildStatus: 1> Touching "Debug\HelloWorld.unsuccessfulbuild". 1>ClCompile: 1> Helloworld.cpp 1>c:\users\jon\documents\visual studio 2010\projects\helloworld\helloworld\helloworld.cpp(2): fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory 1> no such 1>Build FAILED. 1> 1>Time Elapsed 00:00:00.25 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== If I build or Run [Without Debugging], leaving out #include "stdafx.h" it works fine. 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 no such file don't know. Thanks in advance! Scibat Mar 30, 2011 at 5:55pm UTC Disch (13766) Important note to Visual Studio users: Visual studio programs should ALWAYS begin with the following line: That tutorial is wrong. You only need stdafx.h if you make a project that has some prebuilt settings. If you choose to make an empty project with VS, you don't need it. In your case, try removing it. 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. Thanks for the help! Mar 30, 2011 at 7:21pm UTC Disch (13766) You only need it when MSVS gives it to you. If you make a blank project that starts with no cpp files, you don't need it. Usually when you DO need it, VS will give you a cpp file that already has the #include "stdafx.h" line at the time. Topic archived. No new replies allowed. C++ Information Tutorials Reference Articles Forum Forum BeginnersWindows ProgrammingUNIX/Linux Prog