Home » Questions » Computers [ Ask a new question ]

Build for Windows NT 4.0 using Visual Studio 2005?

Build for Windows NT 4.0 using Visual Studio 2005?

"An MFC application that I'm trying to migrate uses afxext.h, which causes _AFXDLL to get set, which causes this error if I set /MT:

Please use the /MD switch for _AFXDLL builds

My research to date indicates that it is impossible to build an application for execution on Windows NT 4.0 using Visual Studio (C++, in this case) 2005.

Is this really true? Are there any workaround available?"

Asked by: Guest | Views: 39
Total answers/comments: 4
Guest [Entry]

To get rid of the _AFXDLL error, have you tried changing to the settings to use MFC as a static lib instead of a DLL? This is similar to what you're already doing in changing the runtime libs to static instead of DLL.
Guest [Entry]

"The workaround is to fix the multi-threaded DLL. Simple instructions. Short summary:

The shipping 8.0 C Runtime Library DLL (MSVCR80.DLL) does not support
NT 4.0 SP6 for one reason and one reason only: someone at Microsoft
added a function call to GetLongPathNameW which does not exist in
kernel32.dll on NT 4.0.

CRTLIB.C On line 577, there is a call to GetLongPathNameW. simply replace it with: ret = 0;
only use this build of MSVCR80.DLL on NT 4.0.

Once you've got those working, coming up with a more generic solution should be trivial."
Guest [Entry]

Although I'm not familiar with afxext.h, I am wondering what about it makes it incompatible with Windows NT4....
Guest [Entry]

"The idea is that the exe is needed to link to the static library.

Please try this
""Configuration Properties"", ""General"", ""Use of MFC"" to ""Use MFC in a Static Library""
""Configuration Properties"", ""General"", ""Use of ATL"" to ""Static Link to ATL""

""Configuration Properties"", ""C\C++"", ""Code Generation"", ""Runtime Library"" to ""Multi-Threaded (\MT)""

Test Platform
Build Machine: Visual Studio 2005 on Window XP SP2
Client Machine: Window XP SP2 (no VS2005 installed)"