0

Like many others on here, I am attempting to teach myself how to Program, and have been using the MIT Opensource classes to try and build the 'Hello, World!' program.

I have followed the instructions, and I believe Ive done everything correctly, however when I go to debug the program, it gives me the dreaded 'System Cannot Find the File Specified' Error.


Disclaimer** Ive searched this site for some answers as I see many new programmers have this problem, but I have not been able to solve the issue following any of the solutions (that I saw). For that reason I decided to post on here - but I apologize if this has already been answered before - I did put in the effort to look before posting.


I would post a screen shot of my program, but I need 10 Reputation points to do so :( I will do my best to give all the information I can.

I am using Microsoft Visual C++ 2010 Express.

I made a new project/Win32 Console Application Location: c:\users\ryan\documents\visual studio 2010\Projects\Ryan

Solution Explorer Looks as follows:

Solution 'Ryan' (1 project)
  >Ryan
    >External Dependencies
        crtdefs.h
        sal.h
        sourceannotations.h
        swprintf.inl
        vadefs.h
    >Header Files
        stdio.h
     >Resource Files 
     (Blank)
     >Source Files
        Hello World.cpp

Code is as follows:

#include <stdio.h>
int main(void)
{
    puts ("hello, Ryan");

    return 0;
}

I saw someone suggest compiling the .cpp file before debugging.

It compiled successfully:

1>------ Build started: Project: Ryan, Configuration: Debug Win32 ------
1>  Skipping... (no relevant changes detected)
1>  Hello World.cpp
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

However, When I go to debug the project - I get the following Error

Unable to start program 'C:\Users\Ryan\Documents\Visual Studio 
2010\Projects\Ryan\Debug\Ryan.exe'.

The system cannot find the file specified.

The Build Output now looks like this:

1>------ Build started: Project: Ryan, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have been trying to figure out how to make this work for several hours now - but clearly I am not doing something...I have a bad feeling its something obvious - but who knows.

if anybody can help me with this - Id really appreciate it. I am trying to learn how to Code for my own benefit - no classes or work requirements, but its frustrating when I cant get the first 'dummy' program to work! :(

Peter Nimroot
  • 545
  • 5
  • 14
  • Are you actually compiling the `Debug` configuration? – πάντα ῥεῖ Nov 26 '14 at 17:44
  • 1
    Make sure Visual Studio is updated to the latest SP: http://stackoverflow.com/questions/12267158/failure-during-conversion-to-coff-file-invalid-or-corrupt – drescherjm Nov 26 '14 at 17:52
  • remove the space from each and every file name, update the build info to show the new names. In particular, this file name: "Hello World.cpp" – user3629249 Nov 26 '14 at 18:19
  • C != C++. Tag only the language you are compiling (in this case, .cpp would indicate C++, even though your code looks like C). – crashmstr Nov 26 '14 at 18:20
  • Consider the solutions in http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval, or try the solutions found on this Microsoft page: http://msdn.microsoft.com/en-us/library/7dz62kfh.aspx – thurizas Nov 26 '14 at 18:54

0 Answers0