Re: [Dev-C++] how to make Turbo C code compile?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Abhijit S. <mu...@gm...> - 2002-12-30 18:40:56
|
Greets, Zach. > I have many code examples from Turbo C 2.x I want to compile in Dev-C++. > What must I do to make these compile or what are tips/techniques to port > the code to some Win32 compilable code? There are probably many differences in the standards that Turbo-C implmented and the current C++ standards that GCC 3.2/2.95 use. The <foo.h> headers are also deprecated and GCC might refuse to compile programs using 'em (depending on what version you have and how it's configured). Instead, you'll have to use <cfoo> and the `using' directive. GCC will warn you about main() not returning int, since I remember that many TC programs used simply `main()', in place of `int main()'. Also, there are the differences in memory-management (far-pointers, segments and offsets versus the linear memory model). Furthermore, DOS interrupts are unavailable in Win32. And programs that assume word-length to be equal to integer length will have problems (in Win32, word-length is short-integer length). For BGI, I remember reading on this list that there's a port for Windows available called WinBGI or something. Check the archives. For programs with <conio.h>, there's an entry in the FAQ. That's all I can think of now. Most of the (simple) examples should be pretty straightforward to port. Simply try to compile, and try to rectify one error at at time. HTH. And people, have a safe, but otherwise chaotic, New Years'. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |