Solved

The system cannot execute the specified program. C++ VS2008 console.

Posted on 2009-04-08
3
2,180 Views
Last Modified: 2013-12-14
Hi,

I'm having problems running a C++ console application that was compiled on another machine using Visual Studio 2008. It runs on the machine it was compiled on, but when I try to run it on my PC, I get the following message...

The system cannot execute the specified program.

I decided to see if I can isolate the problem by creating a simple "hello world" c++ console, but I still get the same message with the "hello world" program.

Leaving me to believe that their is something special about compiling c++ console apps on Visual Studio 2008 and then deploying them to other machines.

Has anyone seen this before or has got a workaround or fix?
#include <iostream>
#include <conio.h>
 
using namespace std;
 
int main()
{
 
	cout << "Hello world";
	getch();
 
}

Open in new window

0
Comment
Question by:silentthread2k
3 Comments
 
LVL 12

Expert Comment

by:Gideon7
ID: 24103805
The required C runtime DLLs are not installed on the computer.  Run vcredist_x86.exe to install the redistributable DLLs (MSVCR80.DLL, MSVCP80.DLL, etc)
The path will be something like "C:\Program Files\Microsoft SDKs\WIndows\V6.0A\Bootstrapper\Packages\vcredist_x86\vcredist_x86.exe".  To install the DLLs copy vcredist_x86.exe to the target computer and run it there.
0
 
LVL 19

Accepted Solution

by:
alb66 earned 500 total points
ID: 24104887
You can download the "Microsoft Visual C++ 2008 Redistributable Package" from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24105369
>>>> Run vcredist_x86.exe to install the redistributable DLLs (MSVCR80.DLL, MSVCP80.DLL, etc)

VS2008 has MSVCR90.DLL and MSVCP90.DL.

VC80  is VS2005.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question