Dev C++ Include Stdafx.h

Posted By admin On 14.12.20
Dev C++ Include Stdafx.h Rating: 7,8/10 356 reviews

Why do i have to include stdafx.h everytime in visual C 2010 express. Evertime i make a project i have to include that damn header, whats so special about it and how can i avoid including it and still compile my program. I have tried to leave it out but it doesnt want to compile then givving an. Mar 04, 2017  Hey, I have made a small function that will enable you to use an unlimited amount of arguments in server source code. For example look at the function doitem in cmdgm.cpp, it gets 2 arguments: arg1 and arg2. Using my function you will be able. Stdafx.h is not 'available', it is project specific. It is an automatically generated file created when you use the Project Wizard creation in Microsoft VC (where presumably this code came from). It serves almost no purpose other to martial precompiled headers (a feature that Dev-C does not have and is of dubious benefit in any case). Hmm I'm still fairly new to c myself only 3 weeks in and I haven't had to use that header for my programs yet. With problem 2 your are typing a meal out but what you are telling your program with int is that you would input a. Stdafx.h is a file, generated by Microsoft Visual Studio IDE wizards, that describes both standard system and project specific include files that are used frequently but hardly ever change. Compatible compilers (for example, Visual C 6.0 and newer) will pre-compile this file to reduce overall compile times.

Hi, friends!

So, I'm making the jump from console C++ to Windows programs, and actually having a lot of fun with that! But my method is, to use my Beginner's edition VC++ to compose the program, and when it's 'done', I switch to the free Bloodshed Dev C++ compiler (because the VC always puts that annoying dialog box you have to dismiss before the program will run, the one that says you can't release your program to the public, end-user-liscence blah,blah).

Usually, I manage OK with finishing a project in Dev that started in VC, but this time I have a dialog-based program that includes <stdafx.h>, which in turn includes five other afx*.h files, too.

Dev C++ throws a fit about this. Even after I copied every relevent header over to the Dev C++'s Include directory, it STILL complains that it can't find the headers!

Clue #1: This application used MFC wizard alot while it was a Microsoft project. Handy for adding all those bells and whistles, but does that doom it as far as Dev C++ is concerned?

Clue #2: I have noticed multiple repeat includes in different files of the project. Microsoft seemed happy with that, and I assumed everything was guarded by #ifndef statements. But do they only work for Visual C++?

Dev C++ Include Stdafx.h

Someone told me once, 'Just wait until you get linker errors!' I see what he was talking about, now.. Mac boot camp partition failed.

Why do i have to include stdafx.h everytime in visual C++ 2010 express. Evertime i make a project i have to include that damn header, whats so special about it and how can i avoid including it and still compile my program. I have tried to leave it out but it doesnt want to compile then givving an arror about forgetting to include stdafx.h.

And if you know how to compile a single source file without having to create a new project i will epreciate it.
I am using Visual Studio C++ express 2010

Oh and if you know where to get a good tutorial about making a simple server-client side TCP chat program in C++ with winsock2.h

Thanks..

Edited by MasterHacker110
  • 2 Contributors
  • forum 7 Replies
  • 454 Views
  • 3 Hours Discussion Span
  • commentLatest Postby MasterHacker110Latest Post

Dev C Include Stdafx.h Photos

Ancient Dragon5,243

VC++ 2010 defaults to precompiled headers which requires stdafx.h. When you create a project you can uncheck that option. If the project is already created you can turn it off in Project --> Properties (last manu item under Projects).

Dev C Include Stdafx.h Pictures

Oh and if you know where to get a good tutorial about making a simple server-client side TCP chat program in C++ with winsock2.h

There is no such thing as a 'simple tutorial'.for that, and under MS-Windows you have no other choice but to use winsock. You might find some boost libraries to replace it. Also I have not use c++11 standards yet but it might also have something new. In any event you are going to need more than just a casual working knowledge of c++ to write that program.

Stdafx.h C++

Edited by Ancient Dragon