Search

0.7 — A few common C++ problems

In this section, we’ll address some of the common issues that new programmers seem to run across with fairly high probability. This is not meant to be a comprehensive list of compilation or execution problems, but rather a pragmatic list of solutions to very basic issues. If you have any suggestions for other issues that might be added to this list, post them in the comments section below.

Problem 1: When executing a program from the IDE, the console window blinks and then closes immediately.

Answer 1: Some compilers (eg. Bloodshed’s Dev C++) don’t automatically pause the console screen after the program has finished executing. If this is the case with your compiler, the following two steps will fix your problem:

First, add the following line near the top of your program:

Second, add the following code at the end of the main() function (right before the return statement):

This will cause your program to wait for you to press a key before continuing, which will give you time to examine your program’s output before your compiler closes the console window.

Other solutions, such as the commonly suggested system("pause") solution may only work on certain operating systems and should be avoided.

Note: Visual Studio will not pause at the end of a console application if it is run with debugging (Debug Menu->Start Debugging). If you want it to pause, you can either use the code solution above, or run your program without debugging (Debug Menu->Start Without Debugging).

Problem 2a: When compiling with Microsoft Visual C++, you get the following error: “c:vcprojectstest.cpp(263) :fatal error C1010: unexpected end of file while looking for precompiled header directive”
Problem 2b: When compiling with Microsoft Visual C++, your program produces compile errors, but your program doesn’t look incorrect.

Answer 2: This occurs when the Microsoft Visual C++ compiler is set to use precompiled headers (which it is by default) but one (or more) of your C++ code files does not #include the stdafx.h header as the first line. To fix this problem, simply locate the file(s) producing the error (in the above error, test.cpp is the culprit), and ensure the following line is at the very top of the file(s):

Note that for programs with multiple files, every C++ code file needs to start with this line.

Alternatively, you can turn off precompiled headers.

Problem 3: When trying to use cin, cout, or endl, the compiler says cin, cout, or endl is an “undeclared identifier”

Answer 3: First, make sure you have included the following line near the top of your file:

Second, make sure cin, cout, and endl are prefixed by “std::”. For example:

Problem 4: When trying to use endl to end a printed line, the compiler says end1 is an “undeclared identifier”

Answer 4: Make sure you do not mistake the letter l (lower case L) in endl for the number 1. endl is all letters. I recommend using a font that makes it clear the differences between the letter lower case L, upper case i, and the number 1. Also the letter capital o and the number zero can easily be confused in many non-programming fonts.

Problem 5: My program compiles but it isn’t working correctly. What do I do?

Answer 5: Debug it! You can find information on how to debug programs in lesson 1, specifically sections 1.11 -- Debugging your program (stepping and breakpoints) and 1.11a -- Debugging your program (watching variables and the call stack).

Problem 6: How do I turn on line numbering in Visual Studio?

Answer 6: Go to the Tools Menu, and choose Options. Under the Text Editor submenu, choose All Languages (or C/C++), and you’ll see a checkbox on the right for Line numbers.

Problem 7: When I compile my program in Visual Studio 2010, I get an error message about a COFF file being invalid. How do I fix this?

Answer 7: If you see the following error when compiling with Visual Studio 2010:

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

You’ve encountered a Microsoft OS/compiler incompatibility. It has nothing to do with your code.

The best first option is to download and install Visual Studio 2010 Service Pack 1.

If that does not fix your issue, there are many other good suggestions on this Stack Overflow thread about the various causes and solutions to this problem.

Problem 8: When I compile my program, I get an error about unresolved external symbol _main or _WinMain@16

Answer 8: This means your compiler can’t find your main() function. All programs must include a main() function.

There are a few things to check:
a) Does your code include a function named main?
b) Is main spelled correctly?
c) Is the file containing main part of your project? (if not, either move the main function to one that is, or add the file to your project. See lesson 1.8 -- Programs with multiple files for more information about how to do this).
d) Is the file containing function main set to compile? (Also see lesson 1.8 -- Programs with multiple files for more information about how to do this).

Problem 9: When I compile my program, I get a warning about “Cannot find or open the PDB file”

Answer 9: This is a warning, not an error, so it shouldn’t impact your program working. However, it is annoying. To fix it, go into the Debug menu -> Options and Settings -> Symbols, and check “Microsoft Symbol Server”.

Problem 10: I’m using Code::Blocks or g++ on the command line, and none of the C++11 functionality works

Answer 10: For Code::Blocks, go to Project->Build options->Compiler settings->Compiler flags and check “Have g++ follow C++11 ISO C++ language standard”

See lesson 0.5 -- Installing an Integrated Development Environment (IDE) for pictures of how to do this.

For compiling with g++ on the command line, add the following to the command line: -std=c++11

Problem 11: I’m using Visual Studio and get the following error: “1>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function “int __cdecl invoke_main(void)” (?invoke_main@@YAHXZ)”

Answer 11: Most likely you’ve created the wrong type of project. Make sure you’re creating a Win32 Console Application, not a Win32 Project.

Problem 12: I ran my program and get a window but no output.

Answer 12: Your virus scanner may be blocking execution. Try disabling it temporarily and see if that’s the issue.

I have some other problem that I can’t figure out. How can I get an answer quickly?

As you progress through the material, you’ll undoubtedly have questions or run into unexpected problems. What to do next depends on your problem. But in general, there are a few things you can try.

First, ask Google. Find a good way to phrase your question and do a Google search. If you have received an error message, paste the exact message into google using quotes.
Odds are someone has already asked the same question and there is an answer waiting for you.

If that fails, ask on a Q&A board. There are websites designed for programming questions and answers, like Stack Overflow. Try posting your question there. Remember to be thorough about what your problem is, and include all relevant information like what OS you’re on and what IDE you’re using.

1.1 -- Structure of a program
Index
0.6a -- Build configurations

173 comments to 0.7 — A few common C++ problems

  • rami

    Answer 12: Your virus scanner may be blocking execution.
    Tahnk u very much, you’re great 🙂

  • George

    I create  “Win32 Console Application”, and was a success.
    Thank you!!

  • George

    yes it appears:
    i get the below when i try to rebuild

    1>---- Rebuild All started: Project: Hello World, Configuration: Debug Win32 ----
    1>  stdafx.cpp
    1>  Hello World.cpp
    1>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
    1>C:\Users\Papalos\Documents\Visual Studio 2015\Projects\Hello World\Debug\Hello World.exe : fatal error LNK1120: 1 unresolved externals
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    • Alex

      I think you may have created the wrong kind of project. Make sure you’re creating a “Win32 Console Application”, not a different kind of project.

  • George

    Hi,
    Using Visual Studio 2015, here’s the error’s I get:

    Severity    Code    Description    Project    File    Line    Suppression State
    Error    LNK1120    1 unresolved externals    Hello World    c:userspapalosdocumentsvisual studio 2015ProjectsHello WorldDebugHello World.exe    1
    Severity    Code    Description    Project    File    Line    Suppression State
    Error    LNK2019    unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)    Hello World    c:UsersPapalosdocumentsvisual studio 2015ProjectsHello WorldHello WorldMSVCRTD.lib(exe_winmain.obj)    1    
        
    I can’t find the uresolved externals!!

    The code i use:
    // Hello World.cpp : Defines the entry point for the application.
    //

    #include “stdafx.h”
    #include

    int main()
    {
    std::cout << "Hello world!" << std::endl;
    return 0;
    }

  • Cersox

    Unless I missed it, the previous lessons didn’t mention that you have to install g++ separate from the IDE or show how. I eventually figured it out, but I was really annoyed up to that point. It’s also worth mentioning that I’m new to Ubuntu and only picked it up because I’d heard Linux was great for programing.

  • Lexxi

    If you see this

    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Users\Lisa\Documents\Visual Studio 2015\Projects\HelloWorld\Debug\HelloWorld.exe’. Symbols loaded.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\ntdll.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\kernel32.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\KernelBase.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\msvcp140d.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\vcruntime140d.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\advapi32.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\msvcrt.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\ucrtbased.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\sechost.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\rpcrt4.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\sspicli.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\cryptbase.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\bcryptprimitives.dll’. Cannot find or open the PDB file.
    ‘HelloWorld.exe’ (Win32): Loaded ‘C:\Windows\SysWOW64\kernel.appcore.dll’. Cannot find or open the PDB file.
    The thread 0x2470 has exited with code 0 (0x0).
    The thread 0x2a28 has exited with code 0 (0x0).
    The program ‘[10728] HelloWorld.exe’ has exited with code 0 (0x0).

    IT MEANS YOU PUSHED JUST F5 and forgot to press ctrl like I did >.>

  • Amrit

    I am using code::blocks IDE in Ubuntu 14.04. I complete my code successfully and then when I try to build(compile) it I get an error message "Can’t create output directory bin/debug".
    Please help me out with this.

  • saeid

    i have one question :
    what is 32767 in

    please explain that .

    • Alex

      std::cin.ignore has an internal buffer where it can store unprocessed input. If it has unprocessed input, when you ask it for input, it will give you the unprocessed input rather than asking the user to enter something.

      The 32767 tells std::cin to remove up to 32767 characters of unprocessed input, which is likely to be all of the unprocessed input. So this has the practical effect of clearing all unprocessed input, so that next time we ask std::cin for input, it will go ask the user (forcing the program to pause).

      Somewhat convoluted, but unfortunately C++ doesn’t have a better system-independent option available for pausing console output.

  • Harry

    Hi, I tried the basic user input code to test it out, then added in another duplicate line to test myself (substituting x for y like so;

    It works fine, but I found that if I entered a letter instead of a digit the program automatically skips to the end "Press any key to continue…" I was curious as to why this was.

    • Alex

      This happens because integer variables can only hold numbers. If you try and enter a letter, std::cin will go into “error mode” and further inputs will be skipped until the error is cleared.

  • Jim R

    Using Visual Studio 2015, here’s the error I get:

    1>c:\users\jrutt.ny-station-36jr\documents\visual studio 2015\projects\consoleapplication2\consoleapplication2\targetver.h(8): fatal error C1083: Cannot open include file: ‘SDKDDKVer.h’: No such file or directory

  • Jason C.

    Another question about the console blinking in and out.

    When I started using Visual Studio Community (the latest free version), it always put the "Press any key to continue…" when it ran my little .exe files. Now, for some reason, it doesn’t and just blinks out.

    Using:

    does the trick, but I’d like to know what I actually did (or didn’t do) to make the pause go away in the first place. Is there some option that needs to be selected for this be auto-implemented that maybe I had set but have somehow unset? Thanks for any help you can give.

    • Alex

      In Visual Studio, if you start without debugging (ctrl-F5), it should auto-pause at the end of the application. If you start with debugging (F5), it won’t pause at the end.

  • Alex

    Quick question, it says g++ is not valid, how do I solve this problem?

  • Rix

    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:UsersDineshDocumentsVisual Studio 2013ProjectsConsoleApplication3DebugConsoleApplication3.exe’. Symbols loaded.
    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:WindowsSysWOW64ntdll.dll’. Symbols loaded.
    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:WindowsSysWOW64kernel32.dll’. Symbols loaded.
    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:WindowsSysWOW64KernelBase.dll’. Symbols loaded.
    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:WindowsSysWOW64msvcp120d.dll’. Symbols loaded.
    ‘ConsoleApplication3.exe’ (Win32): Loaded ‘C:WindowsSysWOW64msvcr120d.dll’. Symbols loaded.
    The thread 0xc78 has exited with code -1073741510 (0xc000013a).
    The program ‘[5292] ConsoleApplication3.exe’ has exited with code -1073741510 (0xc000013a).

    Why is it showing me this instead of "Hello World"? HELP!!!
    This is the code I wrote:
    #include “stdafx.h”
    #include

    int _tmain(int argc, _TCHAR* argv[])
    {
    std::cin.clear();
    std::cin.ignore(32767, ‘n’);
    std::cin.get();
    std::cout << "Hello world!" << std::endl;
    return 0;
    }

  • Dave

    // best simple code for "hello world"

    include <iostream>
    using namespace std;

    int main()
    {
        cout << "Hello World";

        cin.ignore();

        return 0;

    }  // too easy.

  • Hridayesh Sharma

    #include<iostream.h>
    int main()
    {        
        cout<<"Hello World";
        return 0;
    }
    what is wrong in this program. i do not understand the need of using endl and other things
    pleas make it clear to me.

    • Alex

      The only thing I see wrong with this program is that you’ve used cout instead of std::cout (if your compiler allows this, you should probably upgrade).

      std::endl makes the console go to the next line. If you don’t want that, you can omit it.

  • Hridayesh Sharma

    i think to the first problem the solution can be
    #include<conio.h>
    main()
    {
      body of program

      getch();
    }
    the getch(); is a function that is used to hold the screen until you press something and i in defined in header file conio.h
    if i am wrong someone please correct me.

    • Alex

      While this may work on your machine/compiler, I would never recommend this, because:
      1) conio isn’t part of the official C or C++ libraries.
      2) conio is MS-DOS specific.
      3) conio is deprecated (no longer meant to be used).

      In short, conio should not be used in modern programming.

  • Desmond

    This is my program, I followed the instructions and it just makes it to where it makes more spaces before it shuts down.

    #include <iostream>

    using namespace std;

    int main()
    {
        cout << "Hello world!" << endl;

        std::cin.clear(); // reset any error flags
    std::cin.ignore(32767, ‘\n’); // ignore any characters in the input buffer until we find an enter character
    std::cin.get(); // get one more char from the user

        return 0;
    }

  • adrian

    Having trouble trying to fix this error, I have a main function i used the HelloWorld code that you said to test and its not working

    Severity    Code    Description    Project    File    Line
    Error    LNK2019    unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)    HelloWorld

  • plast0000

    in VS we can just hit ctrl+f5 to execute the code and it will print "press any key to continue" at the end of the console app

  • Francis

    when I try to build a program in codeblocks it gives error message "fatal error-iostream:no such file or directory". I have no experience making any programs in code blocks. please help.

  • Ed

    I cannot compile after adding item under one project using Visual Studio 2013 for windows desktop. Does it mean I can only have one file for each project? Any advise please? Fyi I am learning to write c program.

    • Alex

      A project can hold as many files as you want. When you say you can’t compile, what do you mean? What kind of file did you add?

      • Ed

        I try to compile different programs/add items under one project. but it won’t let me, as each source file has its own main() in it. I can compile the program (a) under project 1. But not for program (b) after I try to add it as ‘add a item’ in Project 1. Hope you can provide some comments. Thanks.

        • Alex

          If each of your files has a main(), then you have multiple programs. In Visual Studio, a project can only have one main() function. But you can add multiple projects to a solution file. So it sounds like you should create a new project for each program. These can all be housed in the same solution file for convenience if desired.

  • Divy

    I have to press enter 2 times to end the console window with this code. However, if I comment cin.ignore, I have to press enter only 1 time.
    Why does this happen?

    PS: I am using Visual studio 2013 and running the programming by directly debugging (i.e. F5). When I start without debugging, I have to press enter 3 times(taking in count Press any key to continue..).

    One more thing. When I edited my comment, the code lost its syntax highlight. So I had to delete the previous comment and re-post again.

    Nice tutorials, thanks a lot..

    • Alex

      The cin.ignore() line is meant to clear out any extra input in the buffer so that cin.get() will pause for user input. However, if there is no input in the buffer, cin.ignore() will pause too. So you get a double pause.

      Better a double pause than no pause.

      Strangely enough, although it seems like it should be easy, due to the way C++’s input and output are implemented, I’m not sure a solution that pauses only once in all cases is even possible.

      • Divy

        I don’t understand what kind of errors does cin.clear() will clear ?

        I think a possible solution to above problem would be one statement to clear(not ignore) the input buffer and other statement like cin.get()(this moves forward only by pressing enter and we can press many other keys just before pressing enter) or getch()(this waits for only one character) to pause for user input.

        • Alex

          For example, if you do this:

          But then type in “a”, cin will “break” because you can’t assign “a” to an integer. Consequently, cin will set some error flags to let you know something went wrong. It’ll refuse to process more input until you call clear() on the flags. In other words, if cin were in a bad state, cin.ignore() wouldn’t work unless we called cin.clear() first.

          Unfortunately, I haven’t found a reliable way to clear the input buffer. There are hacks that work on some architectures/compilers, but not on others.

  • I am getting this message "Project not compiled" every time I try to run my C++ source code. this happens even if the program where compiled successfully. what am I doing wrong? help me please!

  • Sid.

    I need help. I use Xcode on mac, but there is nothing on this page that states ANYTHING about Xcode.

  • ChinmayP

    hey Alex, great tutorial. i was doing the first comprehensive quiz and encountered a problem.cin, cout,and endl seem to be not members of std.i tried using std namespace first but it didnt wor so i added std:: but it still gets those errors. Could you please point out what i’m doing wrong?
    ( i’m new to cpp and visual studio 2010 express :p )

    // basic programming1.cpp : Defines the entry point for the console application.
    //

    #include <iostream>
    #include "stdafx.h"

        
    int readNumber()
    {
        using namespace std;
        std::cout<<" Enter number";
        int a;
        std::cin>>a;
        return 0;
    }
    void writeNumber(int a)
    {
        using namespace std;
        cout<<"you entered"<<a<<std::endl;

    }
    int main()
    {
        using namespace std;
        int sum;
        int x = readNumber();
        int y = readNumber();
        sum = x+y;
        std::cout<<"sum ="<<sum<<std::endl;
        return 0;;
            
    }

    errer i’ve been getting:

    1>---- Build started: Project: basic programming1, Configuration: Debug Win32 ----
    1>  basic programming1.cpp
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(5): warning C4627: ‘#include <iostream>’: skipped when looking for precompiled header use
    1>          Add directive to ‘StdAfx.h’ or rebuild precompiled header
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(13): error C2039: ‘cout’ : is not a member of ‘std’
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(13): error C2065: ‘cout’ : undeclared identifier
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(15): error C2039: ‘cin’ : is not a member of ‘std’
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(15): error C2065: ‘cin’ : undeclared identifier
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(21): error C2065: ‘cout’ : undeclared identifier
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(21): error C2039: ‘endl’ : is not a member of ‘std’
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(21): error C2065: ‘endl’ : undeclared identifier
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(31): error C2039: ‘cout’ : is not a member of ‘std’
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(31): error C2065: ‘cout’ : undeclared identifier
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(31): error C2039: ‘endl’ : is not a member of ‘std’
    1>c:\users\svpatil.amphenol-in\documents\visual studio 2010\projects\basic programming1\basic programming1\basic programming1.cpp(31): error C2065: ‘endl’ : undeclared identifier
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    • Alex

      Since you’re using Visual Studio with precompiled headers, the first line of each .cpp file needs to be:

      I think this will fix your issue.

  • Jimmy

    Regarding problem 1:
    When I use this code in my program, I have to press enter TWICE to quit the program. It seems that in case of an empty input stream, the function cin.ignore() waits for some key to be pressed. So, I have to press enter for ignore() and then again for get(). Am I doing something wrong?
    I tried using cin.peek() to check whether input stream is empty or not:

    but it didn’t work - the body of ‘if’ instruction executes always anyway, just as if peek() didn’t return EOF (when it should, cause the input stream is obviously empty).
    Any help?

    • Alex

      Some IDEs will automatically pause the program at the end of execution. Since yours appears to be one of the ones that does this, I’d suggest not using the code to make the program wait at the end. 🙂

      • Jimmy

        I’m sorry, it seems that I wasn’t specific enough. It’s not a matter of IDE. What I described happened without any IDE (text editor + manual compilation on command line). When I tried this in CodeBlocks I had to press enter 3 times to quit (twice for my program and once for CodeBlocks’ final pause).

        It’s not a big deal, I can totally live without this 🙂 I’m just curious why it won’t work.

  • Batuhan

    ok nice points

  • razan

    ‘helloword.exe’: Loaded ‘C:UsersdannyDocumentsVisual Studio 2010ProjectshellowordDebughelloword.exe’, Symbols loaded.
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64ntdll.dll’, Cannot find or open the PDB file
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64kernel32.dll’, Cannot find or open the PDB file
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64KernelBase.dll’, Cannot find or open the PDB file
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64apphelp.dll’, Cannot find or open the PDB file
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64msvcp100d.dll’, Symbols loaded.
    ‘helloword.exe’: Loaded ‘C:WindowsSysWOW64msvcr100d.dll’, Symbols loaded.
    The program ‘[3496] helloword.exe: Native’ has exited with code 0 (0x0).

    • Alex

      This is a warning, not an error, so it shouldn’t impact your program working. However, it is annoying. To fix it, go into the Debug menu -> Options and Settings -> Symbols, and check “Microsoft Symbol Server”.

      • Zach

        Hi Alex,

        When I follow this step, it replaces the "Cannot find or open the PDB file" with "Symbols loaded." Is this as clean as it gets when pressing F5 for the HelloWorld program and beyond? I understand it is just a warning, but I was curious anyway. Also, it is ok that the file for HelloWorld comes out as an executable file (.exe), and I don’t have to change a file or part of the program to .cpp? Thank you.

        ‘HelloWorld.exe’ (Win32): Loaded ‘C:UsersZacharyDocumentsVisual Studio 2017ProjectsHelloWorldDebugHelloWorld.exe’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64ntdll.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64kernel32.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64KernelBase.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64msvcp140d.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64vcruntime140d.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64ucrtbased.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-timezone-l1-1-0.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-file-l2-1-0.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-localization-l1-2-0.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-synch-l1-2-0.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-processthreads-l1-1-1.dll’. Symbols loaded.
        ‘HelloWorld.exe’ (Win32): Loaded ‘C:WindowsSysWOW64api-ms-win-core-file-l1-2-0.dll’. Symbols loaded.
        The program ‘[6796] HelloWorld.exe’ has exited with code 0 (0x0).

        • Alex

          Yup, as far as I know, it always does this if you launch in debugging mode. The file for HelloWorld should come out as an executable, as executable files are the only ones that can be run standalone. The .cpp is just the raw code to be compiled into the executable.

          • Zach

            Great! Thanks so much for the quick response. Will move along forward from here. Will just ignore all the symbol load in the output as long as the output ends with zeroxzero

  • razan

    this is what i get

    1>---- Build started: Project: helloword, Configuration: Debug Win32 ----
    1>  helloword.cpp
    1>c:\users\danny\documents\visual studio 2010\projects\helloword\helloword\helloword.cpp(6): fatal error C1083: Cannot open include file: ‘ isotream’: No such file or directory
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Leave a Comment

Put C++ code inside [code][/code] tags to use the syntax highlighter