-6

this is my first post on here! i started learning C++ a few days ago and i am working my way through bjarne stroustrups second edition on programming. now while i was waiting for the book to arrive i started an online tutorial and got my 'hello world!' program running easy peasy (through visual studio 10). now the book has arrived i thought i would just start again, more writing practice the better right? anyway using his specific header that the book reccomended "std_lib_facilities.h" my program will write and open in console, but i get the error:

'"c:\users\tom\documents\visual studio 2010\Projects\Hello World!\Debug\Hello Wo rld!.exe"' is not recognized as an internal or external command, operable program or batch file. Press any key to continue . . .

now i have been trying to fix this for a while, and no i cant find 'hello world!.exe' in my debug folder, and i cant find how to change the path.

i apologize if this is a silly question, but i dont know exactly what the problem is so i dont know where else to look for answers!

p.s the code is

#include "std_lib_facilities.h"

int main()
{
    cout<<"Hello,World!\n";
    return 0;
}
dandan78
  • 13,328
  • 13
  • 64
  • 78
MrTomDart
  • 1
  • 1
  • 3
    Did you *compile* and see any compilation errors? In Visual Studio, go to Build -> Build Solution. I'm guessing the header file is not found and thus there is no exe to run. – crashmstr Jan 06 '15 at 13:04
  • Please read [ask] before asking another question. Stackoverflow is not a forum and works very differently. – dandan78 Jan 06 '15 at 13:07
  • i had to disable incremental because it was causing a link error but with incremental disabled it fixed that – MrTomDart Jan 06 '15 at 13:09
  • ***c:\users\tom\documents\visual studio 2010\Projects\Hello World!\Debug\Hello Wo rld!.exe*** Is there really a space between the Wo and the rld! in the filename? I mean is that the exact error or did you copy it wrong? Are there any executables in the debug folder: ***c:\users\tom\documents\visual studio 2010\Projects\Hello World!\Debug\*** You may want to turn off hide file extensions for know types in explorer as it causes a lot of confusion when files have the same name but a different extension. – drescherjm Jan 06 '15 at 13:34
  • ***i had to disable incremental because it was causing a link error*** That is unusual. I mean to get a link error for a simple win32 console application which should only be linking to the standard library and crt. Did you apply the updates for Visual Studio 2010? – drescherjm Jan 06 '15 at 13:42
  • the space is not the problem, it starts a new line in the console so C+P did it like that. and no executables in the folder. turning off hide file extensions didnt work either. – MrTomDart Jan 06 '15 at 13:46
  • Are you sure the build succeeded. I mean it is nearly impossible to help given the information that you have presented. We pretty much have to guess the problem.. – drescherjm Jan 06 '15 at 13:49
  • drescherjm, this is the error with incremental linking ON LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt and i updated everything when i first installed VS10 the other day – MrTomDart Jan 06 '15 at 13:49
  • That seems to be a bug in Visual Studio: http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval Did you install Service Pack 1? And update after that? – drescherjm Jan 06 '15 at 13:52
  • im re installing service pack 1, i will let you know what happens! thanks for the help – MrTomDart Jan 06 '15 at 13:57
  • so the LNK1123 is fixed, but now i have a new problem, i have about 30 lines worth of errors regarding the header i am trying to use. – MrTomDart Jan 06 '15 at 14:54
  • You have to post this information in your question along with the header `std_lib_facilities.h`. – drescherjm Jan 06 '15 at 18:56

1 Answers1

1

CTRL+F7 only compiles the program. It doesn't build it. There are two stages needed to build a program, the compile stage and the link stage. Just press F7 instead of CTRL+F7 and try again.

ravi
  • 10,994
  • 1
  • 18
  • 36