NewToVC++
2004-02-01 22:21:07 UTC
Hello,
I have a very basic question. I am an experienced Java developer trying to pick up Visual C++. My problem is that the compiler is not able to find the iostream header file, when compiling from the command line. I hope someone can point out what my mistake. Please help. I wonder if there is some compiler flag that I need to use? I searched the folders under .NET Redist and SDK (Visual Studio .NET) installations on my computer, and I could not find any iostream.h. These are the steps I followed:
Step 1. On Windows 2000 SP 3, I just dowloaded and installed MS .NET Redistributable 1.1 and MS .NET SDK 1.1
Step 2. In a cmd window, I ran the batch file to setup environment:
D:\>"c:/Program Files/Microsoft.NET/SDK/v1.1/Bin/sdkvars.bat"
D:\>Set Path=C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\;C:\WINNT\Microsoft.NET\Framework\v1.1.4322\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\;C:\j2sdk1.4.1_01\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\WINNT\Microsoft.NET\Framework\v1.1.4322;C:\;C:\ERCDTMP;C:\ERCDTMP\BIN;C:\ERCDTMP\TOOLS\PT1
D:\>Set LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\;"C:\Program Files\Microsoft.NET\SDK\v1.1\Lib\";
D:\>Set INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\;"C:\Program Files\Microsoft.NET\SDK\v1.1\include\";
D:\>Set NetSamplePath=C:\PROGRA~1\MICROS~2.NET\SDK\v1.1\
Step 3. I created a file named "hello.c" with this bare-bones code:
#include <iostream>
int main () {
return 0;
}
Step 4. I tried to compile it, but failed with this error:
d:\>cl hello.c
cl hello.c
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
hello.c
hello.c(1) : fatal error C1083: Cannot open include file: 'iostream': No such file or directory
I have a very basic question. I am an experienced Java developer trying to pick up Visual C++. My problem is that the compiler is not able to find the iostream header file, when compiling from the command line. I hope someone can point out what my mistake. Please help. I wonder if there is some compiler flag that I need to use? I searched the folders under .NET Redist and SDK (Visual Studio .NET) installations on my computer, and I could not find any iostream.h. These are the steps I followed:
Step 1. On Windows 2000 SP 3, I just dowloaded and installed MS .NET Redistributable 1.1 and MS .NET SDK 1.1
Step 2. In a cmd window, I ran the batch file to setup environment:
D:\>"c:/Program Files/Microsoft.NET/SDK/v1.1/Bin/sdkvars.bat"
D:\>Set Path=C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\;C:\WINNT\Microsoft.NET\Framework\v1.1.4322\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\;C:\j2sdk1.4.1_01\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\WINNT\Microsoft.NET\Framework\v1.1.4322;C:\;C:\ERCDTMP;C:\ERCDTMP\BIN;C:\ERCDTMP\TOOLS\PT1
D:\>Set LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\;"C:\Program Files\Microsoft.NET\SDK\v1.1\Lib\";
D:\>Set INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\;"C:\Program Files\Microsoft.NET\SDK\v1.1\include\";
D:\>Set NetSamplePath=C:\PROGRA~1\MICROS~2.NET\SDK\v1.1\
Step 3. I created a file named "hello.c" with this bare-bones code:
#include <iostream>
int main () {
return 0;
}
Step 4. I tried to compile it, but failed with this error:
d:\>cl hello.c
cl hello.c
Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
hello.c
hello.c(1) : fatal error C1083: Cannot open include file: 'iostream': No such file or directory