0

This is my code

/* Program #1 - A first C++ program.
Enter this program, then compile and run it.
*/

#include <iostream>
using namespace std;
// main() is where program execution begins.
int main()
{
    cout << "This is my first C++ program.";
    return 0;
}

And this is my error

'ConsoleApplication2.exe' (Win32): Loaded 'C:\Users\tax\source\repos\ConsoleApplication2\Debug\ConsoleApplication2.exe'. Symbols loaded.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ucrtbased.dll'
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ucrtbased.dll'
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'ConsoleApplication2.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
The thread 0x2fb4 has exited with code 0 (0x0).
The thread 0x3748 has exited with code 0 (0x0).
The thread 0x1d6c has exited with code 0 (0x0).
The program '[13476] ConsoleApplication2.exe' has exited with code 0 (0x0).

Please help me as I am supposed to be following allowing this book using CMD and not the IDE through Visual Studio 2017

RebornXD
  • 7
  • 5
  • 1
    There is no error in your output at all. Your program finished and exited normally. – drescherjm Sep 04 '17 at 02:13
  • Likely your real issue is the Windows closes an executable when it finishes so you don't see the output (the window likely opened and closed in less than 1 second). There are 1000s of duplicate questions about that. – drescherjm Sep 04 '17 at 02:15
  • 1
    ISTM you are running through the debugger. Those are not error messages. In fact, your program ran fine with exit code 0. Perfectly fine. Try running without the debugger. For a normal visual c++ keyboard set, Ctrl+F5 to run it. – Joseph Willcoxson Sep 04 '17 at 02:16
  • It doesn't even let me read the code in CMD though why would that be? – RebornXD Sep 04 '17 at 02:17
  • @UnruffledST You don't read anything from your code. – user0042 Sep 04 '17 at 02:18
  • I don't understand what you mean by that. You are not using a cmd.exe. You are running in Visual Studio under the debugger. Your program ran and fished and closed the window. Since the program did that in less than 1 second you will not be able to read the output.. – drescherjm Sep 04 '17 at 02:19
  • @JoeWillcoxson when I pressed Ctrl + F5 it stayed long enough for me to read it – RebornXD Sep 04 '17 at 02:19
  • @drescherjm I was wondering because when I run it through the debugger it shows a pop up saying that there was a build error or that it failed. – RebornXD Sep 04 '17 at 02:20
  • Whatever error you get has nothing to do with the output you added to your question. The can not find pdb warnings should be ignored. That means the debug symbols of windows dlls are not installed on your PC. You don't need that unless you want to dig deep into the implementation of the windows OS. – drescherjm Sep 04 '17 at 02:21
  • 1>------ Build started: Project: ConsoleApplication2, Configuration: Debug Win32 ------ 1>ConsoleApplication2.cpp 1>c:\users\tax\source\repos\consoleapplication2\consoleapplication2\consoleapplication2.cpp(11): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? 1>Done building project "ConsoleApplication2.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== – RebornXD Sep 04 '17 at 02:22
  • @drescherjm that is the error it is providing me – RebornXD Sep 04 '17 at 02:23
  • as I understand I do not need to implement #include "stdafx.h" in my code so I do not understand why this error pops pup and also thank you for helping me – RebornXD Sep 04 '17 at 02:23
  • 1
    Do what it says. – drescherjm Sep 04 '17 at 02:24
  • 2
    ***Did you forget to add '#include "stdafx.h"' to your source?*** Put `#include "stdafx.h"` as the first line of your source file. – drescherjm Sep 04 '17 at 02:24
  • 1
    This is for precompiled headers. When you created your project in the wizard you left the checkbox checked that asked you if you wanted to use precompiled headers. – drescherjm Sep 04 '17 at 02:27
  • @drescherjm should I leave this on? and I do not see this option when opening a new project the only thing checked is create directory for solution. – RebornXD Sep 04 '17 at 03:04
  • Its several dialogs later. For small programs precompiled headers will not help you. For programs like the ones I write for work that have several thousand source files and headers and lots of dependencies precompiled headers save me many minutes each build. – drescherjm Sep 04 '17 at 03:18
  • You can if you want to disable precompiled headers in your project settings for your application. I don't know the exact options to get to it but I know its in the settings. – drescherjm Sep 04 '17 at 03:26

0 Answers0