Error reading from file?

Hey guys I need some help with a problem.. I'm trying to read from a simple txt file and it says I'm missing dll files and the txt file contents doesn't display to the console.

I'm running Windows 8.1 w/ VS2013

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  //Reading Files

#include<iostream>
#include<fstream>
#include<string>

using namespace std;

int main()
{
	string text = "";
	ifstream textfile("text.txt");

	//cheek to see if file was opened
	if (textfile.is_open())
	{
		//loop while we are not at the end of file
		while (!textfile.eof());
		{
			string tempString;
			textfile >> tempString;
			text += tempString;
		}
		textfile.close();
	}
	else
	{
		cout << "ERROR: could not open file" << endl;
	}
	
	cout << text << endl;

	system("pause");
	return 0;
}


My Error:
1
2
3
4
5
6
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.
The thread 0x1ad0 has exited with code -1073741510 (0xc000013a).
*bumb*
closed account (18hRX9L8)
Well, about the warnings, they're not saying you are missing .dll files, they're saying the compiler can't find the PDB files. See here: http://stackoverflow.com/questions/4813975/why-is-visual-studio-2010-not-able-to-find-open-pdb-files .

You have a semicolon at the end of your while statement, which will execute an infinite loop.
Thanks so much usandfriends!
Topic archived. No new replies allowed.