Question

I'm coding a program which is supposed to make an index of text files. I want to get a file from cmd and shows the output (index) in it. when I compile with turbo C, it creates an executable file that I can use it in cmd. but the problem is that when I run it in cmd it says that it's incompatible with windows 7. how I can fix it? notice that I have to use Turbo C compiler.

Was it helpful?

Solution

The 64bit version of Windows will not run 16bit apps without third party intervention. You're building 16 bit applications with Turbo C.

The solutions are:

  1. Run within dosbox
  2. Run From a 32bit Virtual Machine

Running the program from dosbox is trivial. Make sure that the dosbox.exe is in the path. Launch dosbox using the current directory:

dosbox .

Then run the program from the launched dosbox (it looks like a cmd shell).

For a virtual machine you can make the drive that you build the binaries a shared folder with the VM and run them from a cmd prompt within the virtual machine.

As long as the input file is accessible from the environment within which you're running, then you should be able to invoke the command with the filename as a parameter.

While I appreciate that your lecturer is forcing you to use an obsolete compiler in an environment that does not support it properly, you will have to jump through hoops yourself to achieve the solution.

You should also point your professor to the Microsoft Website, where express editions of their compilers are available which work perfectly well on newer versions of windows, are free, support newer versions of the C and C++ specification and will more likely help students if they are actually trying to use C and C++ in the real world.

OTHER TIPS

I think the problem is with the compiler - try getting a newer version, compatible with win 7.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top