my program needs stdafx.h, is there a devc++ equivalent? if so what is it?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-01-12
stdafx.h is not a specific file, it is automatically generated as part of a project build in Visual C++.
VC++ will do this even if your project does not use MFC (I am not sure it has anything to do with MFC, I think it has more to do with pre-compiled headers). It certainly does it if you use the project wizards to create the project.
It often contains nothing, it depends on the original VC++ project, how it was created and what options were set. I would just delete the line and see if it builds. You may need to manually add other windows headers to make it build, but the compiler error messages will indicate what is missing. If your project really does use MFC it will not build in any case.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
stdafx.h is part of the MSVC precompiled header system. It is either empty or random trash to any other compiler. It does nothing for your program so #ifdef, remove, or REM it out. You can even remove it for MSVC though the project may build slower.
stdafx.h is used to contain all the standard header files you are likely to use in your project.
I am not sure how MS is doing their precompiled headers, but I do know that Borland required the header files to be in the same order - otherwise precompiled headers were useless.
Commenting it out, will only cause a whole bunch of heaer files to not be included, which will then cause the compiler to raise those ABC not defined, function_DEF first used before defined etc...
rr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
interseting. as for my program, its a simple program that downloads a web page and will eventually get the information I want from the web page and display it in a simple format.
found the stdafx.h that went with my project.
heres the contents if anyones interested
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
if !defined(AFX_STDAFX_HA9DB83DB_A9FD_11D0_BFD1_444553540000INCLUDED_)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-01-12
Simply replace stdafx.h with both windows.h and wininet.h. You can define WIN32_LEAN_AND_MEAN beforehand if you wish - it may make the build faster, but it amy also exclude API featured you are using.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
stdafx.h typically indicates that you have an MFC based app. stdafx.h simply includes a bunch of MFC headers (which are Microsoft proprietary - i.e. you have to pay for them, so they are not freely available. Even if they were, there are there are specific Microsoft language foibles that would prevent it from compiling).
Of course, all this presupposes you are familiar enough with MFC and wxWidgets in order to make the port (which I doubt, since you are asking about stdafx.h). However, it would be a wonderful learning experience.
rr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
my program needs stdafx.h, is there a devc++ equivalent? if so what is it?
stdafx.h is not a specific file, it is automatically generated as part of a project build in Visual C++.
VC++ will do this even if your project does not use MFC (I am not sure it has anything to do with MFC, I think it has more to do with pre-compiled headers). It certainly does it if you use the project wizards to create the project.
It often contains nothing, it depends on the original VC++ project, how it was created and what options were set. I would just delete the line and see if it builds. You may need to manually add other windows headers to make it build, but the compiler error messages will indicate what is missing. If your project really does use MFC it will not build in any case.
Clifford
stdafx.h is part of the MSVC precompiled header system. It is either empty or random trash to any other compiler. It does nothing for your program so #ifdef, remove, or REM it out. You can even remove it for MSVC though the project may build slower.
//#include "stdafx.h"
http://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html
That is incorrect.
stdafx.h is used to contain all the standard header files you are likely to use in your project.
I am not sure how MS is doing their precompiled headers, but I do know that Borland required the header files to be in the same order - otherwise precompiled headers were useless.
Commenting it out, will only cause a whole bunch of heaer files to not be included, which will then cause the compiler to raise those ABC not defined, function_DEF first used before defined etc...
rr
interseting. as for my program, its a simple program that downloads a web page and will eventually get the information I want from the web page and display it in a simple format.
found the stdafx.h that went with my project.
heres the contents if anyones interested
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
if !defined(AFX_STDAFX_HA9DB83DB_A9FD_11D0_BFD1_444553540000INCLUDED_)
define AFX_STDAFX_HA9DB83DB_A9FD_11D0_BFD1_444553540000INCLUDED_
if _MSC_VER > 1000
pragma once
endif // _MSC_VER > 1000
define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
include <windows.h>
include <wininet.h>
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
endif // !defined(AFX_STDAFX_HA9DB83DB_A9FD_11D0_BFD1_444553540000INCLUDED_)
not much.
thanks for the info.
So you were lucky, all it does it include
windows.h
wininet.h
So, I guess it wasn't an MFC project anyway.
rr
Simply replace stdafx.h with both windows.h and wininet.h. You can define WIN32_LEAN_AND_MEAN beforehand if you wish - it may make the build faster, but it amy also exclude API featured you are using.
Clifford
"my program needs stdafx.h"
Seems to indicate that your sources are written with/for Microsoft's Visual C++ (MSVC) with Microsoft Foundation Classes (MFC).
"is there a devc++ equivalent? if so what is it"
As far as I can tell: No.
What functionality do you need that is described in that header?
Wayne
stdafx.h typically indicates that you have an MFC based app. stdafx.h simply includes a bunch of MFC headers (which are Microsoft proprietary - i.e. you have to pay for them, so they are not freely available. Even if they were, there are there are specific Microsoft language foibles that would prevent it from compiling).
As for an alternative, you can try to port the app to wxWidgets (formerly wxWindows)- which is very much like MFC. IBM even has a step by step guide for doing so. Here: http://www-128.ibm.com/developerworks/linux/library/l-mfc/
You can also read this http://www-128.ibm.com/developerworks/library/l-wxwin.html
Of course, all this presupposes you are familiar enough with MFC and wxWidgets in order to make the port (which I doubt, since you are asking about stdafx.h). However, it would be a wonderful learning experience.
rr