View Full Version : Moving from turbo c

16th December 2007, 08:29 PM
hello, I am wanting to switch from turbo c to linux compiler, gcc I guess? If anyone can give me some advice on the transfer that would be great, really dont know how to do this. I simply copied my TC director to my "Documents" directory and tried "gcc filename.c". There were many errors indicating that my include files were not found. dos.h as an example. I suspect they just need moved to the proper directory? Or is this going to be more complex.


16th December 2007, 08:48 PM
You can't use MS-DOS or Windows functions in Linux. You need to rewrite your code to use Standard C + Linux functions.

16th December 2007, 08:55 PM
Dose that mean that I cannot use linux to create exe's for a dos based computer?

16th December 2007, 09:32 PM
The short answer is "not easily".

The standard compiler in Fedora is gcc. Gcc is a "cross compiler" meaning it can build execuatbles for a different architecture to the host build system. However, this is quite complex to set up. Here's a link I found, if you're really intent on doing this: http://www.ecn.wfu.edu/~cottrell/cross-gtk/

If you want to build software on windows/dos, it's much easier to do it in that environment. You can still use gcc on windows, if you need a free/OSS build environment. See www.mingw.org. Since you're running a linux system, I guess it makes sense to build a few programs on linux to get a feel for things first.

16th December 2007, 10:58 PM
Thanks for the replies

17th December 2007, 01:48 AM
If you are simply looking for a newer compiler than turbo c running on windows:

You can download Borland C/C++ 5.51 for free (or at least you used too) . This is a full windows 32 bit compiler that I still use for production software.

Also you can get gcc for windows too...

Just some other options....

Note that you could try 'wine' or load windows in a virtual box. This would allow you to run windows compilers 'in linux' . I personally develop windows programs in windows and linux programs in linux :) .

If you want to write 'truly' cross platform programs, then use a language such as Java.

17th December 2007, 02:54 AM
This brings up a good point. My target platform is 16 bit. Can i do this with gcc.