'iostream': No such file or directory

Good afternoon, folks. It has been one of those days where absolutely nothing works including things that used to work: Make, OpenGL, PDB files, hello world in visual studio! Nothing works.

Anyway I'm sure there is something I need to reinstall, but I've already reinstalled Visual Studio 2010 Express and MinGW, so I don't know what I'm missing.
1
2
3
4
5
6
7
8
#include<iostream>
using namespace std;

int main()
{
  cout << "Hello, cplusplus!" << endl;
  return 0;
}

1>c:\users\dem7w2\documents\visual studio 2010\projects\helloworld\helloworld\main.cpp(1): fatal error C1083: Cannot open include file: 'iostream': No such file or directory


So what am I missing and what meds are best for headaches?

EDIT: For the record, it seems to be a VS problem. Compiling this file with g++ from cmd works fine.
Last edited on
Well some studies suggest that psilocybin is great for headaches but it also makes it pretty difficult to concentrate, not to mention being slightly illegal to obtain in most places.

My first guess is that you do not have your IDE setup to search for headers in the correct directories. It should explain how to do this when you are installing it IIRC. Otherwise you probably have to add the search directory under the projects options. Then again you could probably just add the directory to your default search paths and be done with it.
Hmmm VC++ 2010 Express gave me no options so I DLed the 2013 30 day trial and it works now. Yay. Thanks though.
Well, I'm still having some issues and I think it's in the same family of problems so I'll post it here as well. I'm trying to compile some C++ code that uses openGL with the following includes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Include standard headers
#include <stdio.h>
#include <stdlib.h>

// Include GLEW
#include <GL/glew.h>

// Include GLFW
#include <GL/glfw.h>

// Include GLM
#include <glm/glm.hpp>
using namespace glm;

#include <common/shader.hpp> 


When RUNNING the compiled program in VS 2013 Ultimate Trial, I get the following output (ignore the fact that it's located in a VS 2010 directory):

'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Users\dem7w2\Documents\Visual Studio 2010\Projects\OpenGL-tutorial_v0012_33\bin\Debug\tutorial02_red_triangle.exe'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ig7icd32.dll'. Cannot find or open the PDB file.
'tutorial02_red_triangle.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Symbols loaded.
'tutorial02_red_triangle.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
'tutorial02_red_triangle.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\winmm.dll'
The program '[5368] tutorial02_red_triangle.exe' has exited with code -1 (0xffffffff).


A window opens (as it should) but then immediately closes. Is the issue with the ig7icd32.dll? I already did the tools->option->debugging->symbol->server, checkmark, so that VS auto downloads missing dlls. The code compiles fine so I don't understand why this isn't working.
so that VS auto downloads missing dlls


No, you have setup to download the PDB files from Microsoft symbol servers. Debugging works with or without them.

So is not clear if the program works or not . Set a breakpoint at the beginning of main() and step through the code to see what happens.
Topic archived. No new replies allowed.