简体   繁体   中英

Why did my exe file not run in other pc? [Debug]

I wrote a simple c program in TurboC+ in my pc.[windows 8 x64].

I compiled it and ran it's without having any error. But after make the exe file tried to run it. But i got a error saying that " The app can't run on your pc. To find a version for your Pc, check with the software publisher ."

Why did i get this error?

And after that i wrote my simple c program in Visual Studio 2008 and i compiled and ran it. And build the exe file.

The exe file runs in my pc. But when i try to run the same exe file in my laptop it shows sow error. I googled the error and somebody wrote that i have to build the exe in release mode. And he said that i can change the mode in configuration manager. But i couldn't find anything in my visual studio 2008.

Can somebody explain me about the Debug and Release things! Please.

I'm really confused about this.

And I'm a beginner in programming. So i don't know much about these stuffs.

Thank you.

First of all C executables are platform dependent which means that you can't run for example an executable compiled for x64 on a x86 processor. (The reverse may work, but that is a special case.)

Also you can't run an executable compiled for Linux on Windows, etc.

The second part of the problem is that your compiler has a standard library (VC runtime or libc, etc.) that can be either statically or dynamically linked with your executable. If it is dynamically linked you have to distribute the standard library alongside your executable.

http://askleo.com/do_i_need_these_microsoft_visual_c_redistributables/

The Release vs. Debug configuration may or may not have anything to do with the runtime being statically or dynamically linked that depends on the compiler and configuration used. You'd have to read the manual for your compiler.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM