views:

340

answers:

4

i am using windows 7 64 bit laptop.i installed turbo c and write programs using dosbox, but i can't run the program.... when run is selected it show some message like not an :exe plz give solution to this problem

+4  A: 

64-bit Windows cannot run 8- or 16-bit executables due to limitations of Long Mode. Use gcc via MinGW or Cygwin to build them instead.

Ignacio Vazquez-Abrams
I think this nails the problem. The Win7 I recently bought included a 64 bit CD and a 32 bit CD and most proud owners of 64 bit capable software wouldn't hesitate to pop in the "better" version. Actually, the 32 bit versions of OS do better in terms of compatibility. MinGW is excellent advice for anyone not wanting to dive into a complete Unix-like environment. If an IDE is needed, I've had good experiences with lcc-win32.
Carl Smotricz
@Carl Smotricz: What modern machine has 4GB of RAM or less? Just the size of the virtual address space means a 64-bit OS provides real benefits. Not to mention the increased number of registers. For compatibility, run a virtual machine - DOSBox has always provided better DOS compatibility than Windows' built-in layer, and a real copy of WinXP in virtualization software can't be beaten for WinXP compatibility!
Borealid
Congrats on finding yourself in an environment of plenty, but I have trouble believing memory richness like that is the norm. At work, I had to fight to get my laptop upgraded from 1G to 2, and my desktop from 2 to 4. Most of the 5 or so PCs I have at home have 2G or less, and even my top-of-the-line gaming box has only 4. Once the extra memory is out of the equation, the performance benefits accorded by 64 bit access is often nullified by the fact that 64 bit programs with their fatter pointers need more memory. Most importantly, there still are more working drivers for 32 than 64 bits.
Carl Smotricz
+1  A: 

It's a DOS program you're building. So you'll have to run it under DOS, too.

Borealid
If he's writing them using the DOS box (as stated), I'd guess he's running them there too.
Carl Smotricz
The problem is that the last OS with a DOS box was Windows ME, which is about a decade old and extinct. Windows 7 comes with a console application (CMD.EXE), but that is _not_ a DOS box. Sure, they look the same, but so does xterm/bash.
MSalters
@MSalters: not "a dos box", but DOSBox ( http://www.dosbox.com/ )
Borealid
I doubt it; that should have worked even on W7.64 (it's an emulator): http://www.dosbox.com/wiki/DOSBox_and_Windows_Vista_and_Windows_7
MSalters
@MSalters: One has to assume that Turbo C wouldn't itself be a different type of binary from what it generates. So he must have been running the compiler differently from how he runs the executable. Note also that this thread is tagged 'dosbox'.
Borealid
A: 

Hi I am using Windows 7 (lap top). recently i had installed Turbo C using DOS box ,after that i executed one program but later when i tried to run the program entire dosbox window is getting closed ..tried even different cpu cycles ( auto,fixed,max) but still not ok ..pls help on this...Vani

Vani
A: 

Do not use shortcut ctrl+f9 to run program as it is also a shortcut to close DOSBOX. use menu tab to compile and run programs.

lovee