0

Hi I have been having problems with Microsoft VS.

When I try to run simple code such as:

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

using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
    cout << "hello" << endl;
    return 0;
}

I get an error message saying: "Unable to start program 'C:\elevator\Debug\elevator.exe'.' the system cannot find the file specified"

This message has been coming up for a long time. I do not believe it's any problem with my code. My program will be compiling fine then all of a sudden this error will come up without me even changing the code. I have tried uninstalling and re installing VS which didn't work. I have also spent a long time searching Google for the solution to no avail.

This is the output I get when trying to run the above code:

1>------ Build started: Project: elevator, Configuration: Debug Win32 ------

1>Build started 26/02/2014 14:49:21.

1>InitializeBuildStatus:

1>  Touching "Debug\elevator.unsuccessfulbuild".

1>ClCompile:

1>  All outputs are up-to-date.

1>  All outputs are up-to-date.

1>ManifestResourceCompile:

1>  All outputs are up-to-date.

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

1>Build FAILED.
1>

1>Time Elapsed 00:00:00.20

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Cory Kramer
  • 114,268
  • 16
  • 167
  • 218
user3057816
  • 11
  • 2
  • 8
  • Your problem seems to be a link erro: "LINK : fatal error LNK1123" did you try googling that? Perhaps this could help http://stackoverflow.com/questions/10888391/error-link-fatal-error-lnk1123-failure-during-conversion-to-coff-file-inval –  Feb 26 '14 at 15:20

2 Answers2

0

Maybe you have an anti-virus that detects your new program as problematic, and puts it to quarantine as soon as it is compiled.

lrineau
  • 6,036
  • 3
  • 34
  • 47
0

I think I've found a solution for some C++ projects in vs2010. If you are using 'incremental linking' you will have this "fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt". In my case I've swiched it to "No", and now project compiles and run without any problem.

If you want to try go to: Project Properties -> Configuration Properties -> Linker (General) -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"

about "Incremental Linking": http://msdn.microsoft.com/en-us/library/4khtbfyf(v=vs.100).aspx