Visual C++ Express Edition can not compile the Doom 3 source code because it does not include MFC.
It can be successfully compiled and run if MFC dependencies are stripped:
- Linker references to nafxcw.lib need to be removed
- The StdAfx.h reference in precompiled.h can be disabled as everything in that file is MFC-related
- ID_ALLOW_TOOLS in BuildDefines.h needs to be disabled
- The afxwin.h include in win_taskkeyhook.cpp is unnecessary and can be removed
- Everything under Tools except for Compilers needs to be excluded
- Everything under Sys/RC needs to be excluded
- win_shared.cpp needs replacements for a few COM assist templates. I've created this header which implements some compatible replacements: http://icculus.org/~riot/win_nanoafx.h
This could be implemented as a new configuration.
Created attachment 3007[details]
Modified files for proposed patch
Adding proposed patch. This adds two new configurations named "Debug without tools" and "Release without tools", removes MFC dependencies from the default property pages, and adds MFC dependencies to the non-dedicated release and debug configurations.
Attachment 3007[details] shows a diff of what looks like many changes to multiple header, props, vcxproj files. I believe this might be what Prashkp was referring to? Is there a way to download these modified files? Going through the diff and applying the changes manually would be very error-prone and time consuming.
Apologies if there is an obvious way to do this; I'm new to Bugzilla.
This may be useful to someone.
I found the attached diff missing info (mainly filenames) to do a git apply. Anyway I have attached a dirty patch for those needing a quick fix (see attached unified diff file).
This patch just ignores the MFC parts of the build and is not elegant as Eric's solution.
Those not wanting to use the patch, the solution is to:
Comment the lines (in neo/framework/BuildDefines.h)
#if defined( _WIN32 ) && !defined( ID_DEDICATED ) && !defined( ID_DEMO_BUILD )
#define ID_ALLOW_TOOLS
#endif
add the line (in neo/sys/win32/win_shared.cpp) as mentioned by Eric
#include "win_nanoafx.h"
comment the line (in neo/sys/win32/win_taskkeyhook.cpp)
#include <afxwin.h> // MFC core and standard components
comment all the lines (in neo/tools/comafx/StdAfx.h)
remove all BUT the following folders in the Tools folder within the DoomDLL project for your solution (I used Release)
Compilers, Debugger, edit_public.h
Finally remove the nafx*.lib references in the project properties under Linker->Input and in _Release.props (assuming you are doing a release build). If the build complains about nafx*.lib, you have missed the project properties somewhere.
I may have missed some steps, review the patch file in a text editor for more info.
Cheers
Shakes
Created attachment 3130[details]
Ignore MFC dependencies (quick and dirty) patch
A quick and dirty patch to ignore the MFC dependencies within iodoom3 build so that Visual Studio Express 2010 can be used for windows build.
Created attachment 3007 [details] Modified files for proposed patch Adding proposed patch. This adds two new configurations named "Debug without tools" and "Release without tools", removes MFC dependencies from the default property pages, and adds MFC dependencies to the non-dedicated release and debug configurations.
Created attachment 3008 [details] Additional files for proposed patch
Attachment 3007 [details] shows a diff of what looks like many changes to multiple header, props, vcxproj files. I believe this might be what Prashkp was referring to? Is there a way to download these modified files? Going through the diff and applying the changes manually would be very error-prone and time consuming. Apologies if there is an obvious way to do this; I'm new to Bugzilla.
Created attachment 3130 [details] Ignore MFC dependencies (quick and dirty) patch A quick and dirty patch to ignore the MFC dependencies within iodoom3 build so that Visual Studio Express 2010 can be used for windows build.