sign in • sign up
web   discussions   tasks   blogs   photos

[Beginner's question] Why the exe file cannot be opened in all computers?  email this discussion to a friend?

myLot reputation of 58/100. sn_2818184 (272) 3 years ago

I've just started learning C++ programing in my university. To have a easy reference to my textbook, I use Microsoft Visual Studio 2005.

Of course, to start learning a programming language, the first program is usually the HelloWorld program. I'm no exception. I've learnt Pascal and thus, this is easy to me and a exe file is generated successuflly in the first time. It ran successfully in my computer.

However, when I move the file to another computer, the file cannot be run successfully, with the error message telling me that some setting of my program is wrong, asking me to reinstall the program. (which is of course impossible...)

The file path: C:\...\HelloWorldProject\debug\HelloWorldProject.exe

The only way out is to use the source code to compile the program again in that computer. However, the exe file compiled there also cannot be run in other computer. In other words, due to unknown reason(s), the exe file is machine dependent!

As far as I know, C++ is not a machine dependent programming language. So, what's wrong with my file? How can I compile a file that is machine independent?

 

programming
sponsors
Web Developer MS Degree
Become a Skilled Web Developer w/a Master's Degree in Internet Systems
EducationDegreeSource.com/Online_MS

Online Degrees
Top Online Degrees. Get the Education You Need To Succeed.
www.onlineuniversities.net

Top 2011 Online Grants
Grant funding may be available - Go Back to School!
www.ClassesUSA.com

User has not selected a best response.
tags:  classes, computer programming, distribute, download, executable file
 
1. fglswh (58)   ranked 14 out of 65 in programming   3 years ago

I have not used VC++, but i have used Delphi to develop software. If your program is very simple, the error should not happen, unless you have coded a complex program. In order to resolve this problem, you'd better paste the error message.

Web Developer MS Degree Become a Skilled Web Developer w/a Master's Degree in Internet Systems  EducationDegreeSource.com/Online_MS
 
2. myLot reputation of 96/100. kaka135 (3362)   ranked 10 out of 65 in programming   3 years ago

Well, I'm using Microsoft Visual Studio 2005 to build web applications, and some Windows applications too. I always created a setup file for me to install the Windows application in another computer, instead of just copy the executable file over, as the application needs to run with some other dependencies.

Have you checked the correct path for the HelloWorldProject.exe? As you mentioned the file path is C:\...\HelloWorldProject\debug\HelloWorldProject.exe, it seems to be the path in your computer where you developed the project, but the path may not exist in the other computer.

The executable file may need to run with some dependency files, I suppose .NET Framework is one of the dependencies. Though Microsoft said that the applications are machine-independent, it has to install .NET Framework at least, if I am not mistaken.

Try to create a setup file and install it in the other computer, it'll help you to install the necessary dependency files too.

Online Degrees Top Online Degrees. Get the Education You Need To Succeed.  www.onlineuniversities.net
 
3. valorz (10)   3 years ago

maybe you have to install the .net framework 2.0 on the computer which you want to run your program on

Top 2011 Online Grants Grant funding may be available - Go Back to School!  www.ClassesUSA.com
 
4. shanmukhsista (72)   ranked 8 out of 65 in programming   3 years ago

If you are using visual studio environment to develop a windows application then to run the program you must have dot net framework required that you selected when creating a new project.
Try running with .net installed or on windows vista or later. Windows vista contains .net framework inbuilt so no need for installing.

Study Psychology Online Find & Compare Psychology Degree Programs Online Now.  universaldegrees.com
 
5. myLot reputation of 86/100. myzire72 (1085)   3 years ago

I think you are lacking the .Net framework which is mandatory for your program to run. It's just like Java, if without the dependent classes, simply won't run. In fact, keep this in mind in future if you distribute or sell your software applications. Let your users know they have to install the .Net framework before they can run your software. If possible, include the link to download or let your software determine whether .Net framework is installed, and if not, download and install automatically from Microsoft.

Fix Computer Problems Check your PC for errors that can impact its performance. FREE SCAN.  www.ReviverSoft.com
 
sponsors
Study Psychology Online
Find& Compare Psychology Degree Programs Online Now.
universaldegrees.com

Fix Computer Problems
Check your PC for errors that can impact its performance. FREE SCAN.
www.ReviverSoft.com

Computer Programming
Looking For Computer Programming? Find It Nearby With Local.com!
Local.com

similar discussions
When classes are suspended..
As a student, it is my student to be present in school every schooldays. I should be attentive in...
Carreers help!!!
I want to work with computers, fixing them and programming. Any ideas of carreers of something...
kicked out!
Well I failed one of my classes which caused my funding to stop, now I'm kicked out until I pay the...
My boss wants me to take a health and safety course.
She says that it could help us get more work, and hopefully it does. I looked into the courses...
Fun to go back to university.
I started short term courses on import and export at my old university. I felt so exciting! I...
sponsors
Study Psychology Online
Find & Compare Psychology Degree Programs Online Now.
universaldegrees.com
Fix Computer Problems
Check your PC for errors that can impact its performance. FREE SCAN.
www.ReviverSoft.com
Computer Programming
Looking For Computer Programming? Find It Nearby With Local.com!
Local.com
Online Christian College
Online Accredited Christian College. Ready to answer God’s call?
www.nbc.edu
Halliday Solutions Manual
View Even & Odd Halliday Textbook Problems Explained Step-By-Step!
Cramster.com/Physics_Halliday
return to mylot
We are loading a word from our sponsors. No thanks, cancel loading.