Question about Compile Behavior in Visual Studio

This is a discussion on Question about Compile Behavior in Visual Studio within the C++ Programming forums, part of the General Programming Boards category; another noob question incoming.. So i was doing a few more tutorial programs, and i noticed that When i changed ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    4

    Question about Compile Behavior in Visual Studio

    another noob question incoming..

    So i was doing a few more tutorial programs, and i noticed that When i changed some text string outputing through cout like

    Code:
    cout << "Awesome \n";
    adding a Exclamation Point for example:
    Code:
    cout << "Awesome! \n";
    i noticed that when i hit F5 and recompiled it, The changes i made to any of the code wouldn't affect how the program ran the next time i hit F5.

    Eventually i determined that i could close all windows, save it there, then reopen it, and changes to the code i'd made would take affect after that. But is there another way i could update the compiled program without having to close the windows out first?
    Last edited by Tachimazu; 06-21-2009 at 08:59 PM. Reason: title update

  2. #2
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    you need to relink it
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  3. #3
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    F5 doesn't compile, it just runs your code in debug mode. You need to be hitting F7.

    When you're hitting F5 all you're doing is running your last compiled piece of code.

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,302
    It sounds like you've left the console window open after each time you run your program. As compiling involves opening the exe for write access and replacing its contents, this cannot happen while the process is still loaded. You have to close the console windows first, end of story.

  5. #5
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,546
    This may be true if you have some instructions left in the program to "prevent the console window from disappearing." Otherwise, the process will terminate as soon as it gets to its end (even if you do Ctrl+F5).
    So yes, remove any such instructions to prevent it from disappearing.
    Hit F7 to compile each time.
    Run with Ctrl+F5.
    It solve all your problems.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Jun 2009
    Posts
    4
    oh i see. Thanks yall.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 03:09 AM
  2. multiple errors generated by socket headers
    By nocturna_gr in forum Windows Programming
    Replies: 5
    Last Post: 12-16-2007, 05:33 PM
  3. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM
  4. Visual Studio .Net Question
    By loko in forum C++ Programming
    Replies: 7
    Last Post: 09-05-2005, 07:54 PM
  5. SystemTray class
    By jair in forum C++ Programming
    Replies: 2
    Last Post: 07-28-2003, 06:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21