1

I'm watching some tutorial videos on x64 C++ and ASM

The guy is using Visual Studio 2010

I put the simplistic app together. I'll paste it below.

It builds successfully.

I cannot see any output.

I don't get it. He (i.e., the video tutorial author) gets a command window with ascii text output. I get no action at all.

In fact, when I choose to debug, the commands for step into, step out, and step over of are all grayed out.

So I hit Break All and I'm in some of the system's header files.

If I put breakpoints in any of the real code, they never hit, not even the first line in main()

The only suspicious thing that I can think of is that I have Visual Studio 2010, Visual Studio 2010 Express, Visual Studio 2012, and Visual Studio 2012 Express, all on this same (Win'7, 64 bit) machine.

If that is indeed the reason, then why is VS C++ properly building the app ?

I haven't done any Visual C++ before; this is my first attempt. Hopefully this is something simple, and I won't have to uninstall any of the apps.

This is the code...

#include <iostream>

using namespace std;

extern "C" int GetValueFromASM();

extern "C" int TheExternalFunction();

int main()
{

    int Fred;
    long Frederick;

    Fred      = 123;
    Frederick = 12345;

    cout << Fred       <<  endl;
    cout << Frederick  <<  endl;
    cout << "Jones"    <<  endl;
    cout <<  692317    <<  endl;

    cout <<"When you see this, it Works"<<GetValueFromASM()<<endl;
    cout <<"When you see this, it Works"<<TheExternalFunction()<<endl;


    cin.get();      /* Pause the screen so it doesn't go away */

    return 0;       /* End Of Program */
}

Thanks for any help.

I see that five other users (with far higher reputation levels than I have) claim that this question already has an answer at the link stated, I spent a lot of time there, and the 453 word answer left me scratching my head while the 24 word answer in the comments section of this question was exactly on target. Contrasting the (reputedly) duplicate question and its (reputed) answer, I can honestly report that...

  • The time spent on the 453 word answer was more than an hour.
  • The time needed to put that into practice exceeded infinity.
  • The time needed to read the 24 word answer was about 30 seconds.
  • The time to put it into practice was about 3 or 4 minutes.

If that constitutes duplication, then so be it. The answer provided here was infinitely (quite literally) more helpful, more clear, and above all, was understood the moment I read it. This experience was the exact opposite of the (reputedly) "duplicate" question which had the "answer" I was seeking.

i.e., the 24 words communicated a message that worked. The 453 did not.

User.1
  • 2,562
  • 3
  • 33
  • 40
  • 1
    Change your program to be a console application. This can be done I think in Configuration->Linker->Subsystem. Then you get a command window. – mkaes Aug 30 '14 at 09:09
  • 1
    That did it. Thanks. Plus one for your comment. Put up an answer and I'll choose it and vote it up. – User.1 Aug 30 '14 at 09:27
  • http://stackoverflow.com/questions/13840942/visual-studio-2012-c-standard-output/13841522#13841522 – drescherjm Aug 30 '14 at 12:46
  • 2
    @User1: Since this is a duplicate and the other answers completely answers the question, this one should be closed as an duplicate. – mkaes Aug 30 '14 at 17:28
  • The other question answers this question as a tiny subset of much larger issues. Nobody is ever going to find that by looking for anything that that question asks. – User.1 Aug 30 '14 at 20:48
  • I have now edited the original question with reference to the other purported answer which I examined. – User.1 Aug 31 '14 at 01:47

0 Answers0