Reputation: 15
I am using visual studio 6 , vc++ on windows 7 and written a simple helloworld program which is by default created by VS6. but due to printf it is giving following error:
// testapp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
Error :
--------------------Configuration: testapp - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
testapp.cpp
D:\PROJECTS\FATT\testapp\testapp.cpp(8) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'E:\8783\vc98\p2\src\P2\main.c', line 494)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
testapp.exe - 1 error(s), 0 warning(s)
why printf and sprintf not working?
Upvotes: 1
Views: 1206
Reputation: 536
My first thought was that VS6 SP6 might be required. (Previous answer). Large projects will fail (with lots of files) there is a CL.exe crash that is also fixed in SP3. You need to not install all of the VS6 in the install for Win7 and newer. There is a package that needs to be skipped, ADO/RDS and OLE Providers. If you attempt to install these components the VS6.0 install will hang out of the box, and later the VS6 SP6 will not install properly.
I did a lot of work in the Amazon Cloud in 2015 to see if VS6.0 will install in Win2012, and it does. I assume Win7/8/10 will be similar.
There is also a /GF (String Pooling) bug we found last year (2016) in VS6.0 which can really mess things up if you have runtime searches of strings. Two different string names can be pooled into a single string so searching through a list of strings will never find one of the two at runtime. /GF is implied by /ZI (IIRC) so change to /Zi. (I may have that switched). Recommendation is to move from VS6.0 -> ON ASAP. I know that might not be possible :(.
Upvotes: 0
Reputation: 17638
If you really run VC++ 6 without any service packs applied, then it could be this:FIX: You receive a "Fatal error C1001" error message when you compile by using the /ZI and /Yc command-line switches without a file name in Visual C++ 6.0.
When you compile in Microsoft Visual C++ by using the /ZI and /Yc command-line switches without a file name, you may receive the following error message: fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'E:\8168\vc98\p2\src\P2\main.c', line 494)
STATUS
This bug was corrected in Visual Studio 6.0 Service Pack 3.
WORKAROUND
To work around this problem, use one of the following methods:
Compile by using the /Zi command-line switch instead of the /ZI command-line switch.
Supply a file name by using the /Yc command-line switch. For example, use the following syntax: /Yc"FileName"
Upvotes: 1