Discussion:
[Dev-C++] how to make Turbo C code compile?
Zachary Uram
2002-12-30 15:45:02 UTC
Permalink
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?

I can post some sample code if you want.

Thanks and HAPPY NEW YEAR!

Zach


Zachary Uram
John 3:16
<><
Abhijit Shylanath
2002-12-30 16:41:16 UTC
Permalink
Greets, Zach.
Post by Zachary Uram
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: ***@gmx.net || ***@bigfoot.com
Web-site: http://mudeth.tripod.com/
Abhijit Shylanath
2002-12-31 07:31:08 UTC
Permalink
Greets, Abhijit :)
Post by Zachary Uram
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?
For BGI, I remember reading on this list that there's a port for Windows
available
called WinBGI or something.
WinBGI is available at (unverified link):
http://www.ispras.ru/~knizhnik/winbgi.zip

HT Works.
___________________________________________________________

Abhijit Shylanath

E-mail: ***@gmx.net || ***@bigfoot.com
Web-site: http://mudeth.tripod.com/

Loading...