Home › Forums › C Programming › clrscr(), window(), textcolor() etc. not in conio.h?
- This topic has 5 replies, 2 voices, and was last updated 14 years, 9 months ago by GWILouisaxwzkla.
- AuthorPosts
- February 16, 2010 at 11:16 pm #2239SylvestQqzParticipant
Hello, I am a C newbie. I’m trying to recompile some very old C 16 bit programs that are called by a VFP program. The problem is that I need this VFP program to run on a 64 bit machine/ compile at least as 32 bit. My objective is to just get this compiled. I don’t have the time (right now) to dive into lots of work understanding the intricacies of c and c++.So hopefully there is a simple solution that doesn’t involve a lot of rewriting.
I downloaded Visual c++ 2008 express edition, which comes with a command line compiler (cl.exe) I was hoping I could just call
cl.exe old_c_prog.c and it would work. A few of the programs do. However several of the programs have references to functions like
clrscr(), window() textcolor(), textbackground,highvideo(), textattr, gotoxy() From the research I did it looks like these functions should be found in conio.h, which I have a #include for. However, I am hazy on this, but it looks as the implementation of conio.h that has these functions is for turbo C?Is there some other .H file that I can include which supports these old console functions? (and will work with 64 bit machine)
Or maybe there is some other compiler that will work?
- February 17, 2010 at 9:06 pm #3631GWILouisaxwzklaParticipant
The functions clrscr(), ect. are exclusive to the Borland Turbo Compiler. I think the easiest way to compile the code would be to download the free Borland Command Line Tools Package ( I think you can find it here: http://edn.embarcadero.com/article/20633 ) or just google free Borland Command Line Tools Package download. You could also write your own replacement functions and add them to the one of the VC++ library ( could code these using Windows API calls for 32-bit Windows applications ).
- February 18, 2010 at 5:01 pm #3632SylvestQqzParticipant
It turns out that I figured this out shortly after I posted – and that’s exactly what I did, ie. download the Borland compiler. Much better results now, however, now I have a new set of issues and questions.
When I compiled with the Borland compiler it gave me a ton of warnings stating that function prototypes were missing. It would error out after a certain number of these warnings. Then I added a command line flag to tell it to ignore up to 255 warnings – this worked, and, I guess from that standpoint my task is done. However, I didn’t like the idea of these warnings. I have others to compile and I am concerned that I will reach the upper limit of the # of warnings to ignore. So I researched it and found that there was a ‘makeheaders.c’ program which would create the function prototypes for me. I tried this but for the life of me couldn’t get this to work – created the headers and tried to include the .h files for them – but it wasn’t working. Can provide more details on this if needed.
Then I decided that I would try to copy conio.h from borland over to the visual studio c++ environment as conio2.h
The more I got into this the messier it got. Then I read a post somewhere else stating that ‘copying borland headers over to visual studio will not work’. So I am inclined to give up this idea you think there is a simple way to do this.So, now I am thinking that I should stick with the Borland compiler and live with the warnings for now. But ideally I’d like to figure out how to get the function prototypes to work – it looks straightforward. I don’t know what could be wrong.
Please advise on which path you think would be the best to take.
Thanks!
@dman wrote:
The functions clrscr(), ect. are exclusive to the Borland Turbo Compiler. I think the easiest way to compile the code would be to download the free Borland Command Line Tools Package ( I think you can find it here: http://edn.embarcadero.com/article/20633 ) or just google free Borland Command Line Tools Package download. You could also write your own replacement functions and add them to the one of the VC++ library ( could code these using Windows API calls for 32-bit Windows applications ).
- February 18, 2010 at 7:16 pm #3633GWILouisaxwzklaParticipant
I haven’t used this compiler for a looong time , but as I remember you have to do a few small things to configure it or it will not work properly. Heres a link that shows how to configure it http://edn.embarcadero.com/article/21205 , you can also google set up Borland command line tools .
- February 20, 2010 at 12:21 am #3634SylvestQqzParticipant
Hello again dman. In the meantime I was able to get the function prototypes to work. I had already done the setup steps and I think the compiler is setup fine. The problem, I think, was that I was trying to use makeheaders without really understanding what it was doing. I ended up making the function prototypes manually. Now I have everything compiled without warning or errors.
However, now I have a new problem. One of my exe’s bombs out at runtime. I can’t see where this command line compiler has a debugging / runtime environment. I vaguely remember a debugging environment for Turbo C, but the last time I used it was in 1992! How can I step through this code in a debug environment?
Thanks.
@dman wrote:
I haven’t used this compiler for a looong time , but as I remember you have to do a few small things to configure it or it will not work properly. Heres a link that shows how to configure it http://edn.embarcadero.com/article/21205 , you can also google set up Borland command line tools .
- February 21, 2010 at 9:43 pm #3635GWILouisaxwzklaParticipant
Theres a seperate debugging utility called “turbo debugger” or something. Its a small DOS box utility that debugs object files made with Turbo C++ , as I remember. Heres a link to some info on this http://www.winprog.org/tutorial/bcpp.html
- AuthorPosts
- The forum ‘C Programming’ is closed to new topics and replies.