Need help with graphics.h in XP

How do I get graphics.h and DOS to work on XP? If I remember right, DOS doesn't come with XP, correct? I am using Borland Builder 6. I know graphics.h doesn't come with Builder 6, but I copied the graphics file from my old borland and it still wouldn't work. Thanks.
jrobinson3k1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

efnCommented:
Somebody else had a similar question six months ago.  Maybe this will help:

http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20598755.html
Paladin_VBCommented:
I can help you . I had the same problem I guess that you are using a windows compiler meaning BGI graphics will not work unless you have a dos compiler. Also if im right XP does not even include dos so you could not get one any way . If you want my advice look into OpenGL .
jrobinson3k1Author Commented:
Well I know its possible cuz I know of people that do it, but I cannot get a hold of them to know. The website efn gave me seemed that it WOULD work, only problem is that the website doesnt host those files anymore. If I could get a more efficient direct link I will dish out the points.
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

efnCommented:
The WINBGIM files are available from

http://www.cs.colorado.edu/~main/bgi/

WINBGIM is based on WinBGI, which is available from the bottom of this page:

http://www.garret.ru/~knizhnik/winbgi.zip

--efn
jrobinson3k1Author Commented:
I can't seem to get it to work w/ Borland 6. I'm having trouble finding the options to get it how it needs to be for winbgim.h to work. When I try to run a program with it the only errors I get are relating to multiple declarations for all the colors disputing between the winbhim.h and conio.h headers. Any ideas?
efnCommented:
I don't think we can help you without more information.  For what it's worth, I made a console application that included both conio.h and winbgim.h and it compiled without error in C++Builder 4.  It didn't actually do anything, though.

--efn
jrobinson3k1Author Commented:
Well what more do you need to know and I can tell you. Do you have Borland 6 or familar w/ it?
jrobinson3k1Author Commented:
Is OpenGL like BGI, just more modern for Windows?
efnCommented:
> Well what more do you need to know and I can tell you.

Are you working with a console application?  Have you tried to make a minimal test program that just includes those two files and doesn't do anything?  Have you tried repeatedly cutting pieces of your program out until it compiles?  Exactly what error messages are you getting?  What is the code that is generating the messages?

For general advice on how to ask for programming help, see:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8

Have you tried any of the WINGBGIM sample code?  Since I posted my last comment, I tried the sample code from the documentation on the kbhit function.  After I corrected one error, it compiled and ran.

> Do you have Borland 6 or familar w/ it?

No, but this technology is so old that I doubt that it matters.  It could, though.

--efn
jrobinson3k1Author Commented:
Are you working with a console application?  Yes
Have you tried to make a minimal test program that just includes those two files and doesn't do anything?  Yes
Have you tried repeatedly cutting pieces of your program out until it compiles?  Yes
Exactly what error messages are you getting?  What is the code that is generating the messages? There is no errors in my cpp file, but the errors lie in a conflict between conio.h and winbgim.h. I don't even include conio.h and it loads it up. I guess winbgim.h uses conio.h, I didn't look for that. The errors, as I stated, are multiple declarations of the colors (eg. BLACK, BLUE, RED, etc.), since winbgim.h AND conio.h declare the colors.

I haven't had Borland 6 long, so I don't know how to tell the project to function to run BGI, use Win32, use the dynamic library, or any of that stuff. The reason I want to be able to use graphics.h functions is because at school (where I am now) we use Borland 5.02 and we use BGI graphics (Yes, its out-of-date, but I go to a small high school so it's all we got). At home, I have Borland 6, so that conflicts between my school programs and home programs and I want to be able to take my programs from school and edit them at home and compile and run them.
jrobinson3k1Author Commented:
OK, everything works fine w/ winbgim at school, which runs Borland 5.02. I think my problem is getting all the settings for my project right, so I need to figure out how to change my options for that. I'll try it later when I get home. I appreciate all your help so far.
jrobinson3k1Author Commented:
increasing points to 100
efnCommented:
You must have either _WINDOWS_H or _GNU_H_WINDOWS_H defined in your environment.  I bet if you get them undefined, the compile errors will go away.

Edited from winbgim.h:

#if defined(_WINDOWS_H) || defined(_GNU_H_WINDOWS_H)
    /* MINGW32 G++ Compiler:
    *  Define the colors type in the same way that Borland does.
    */
    enum colors {
        BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY,
        LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE
    };
#else
    /* BORLAND Compiler:
    * Colors are already defined in the BC5 conio.h, using COLORS.
    * So for Borland I'll replace this enum with a #define definition.
    */
    #define colors COLORS
#endif

I was able to reproduce your problem by adding this line to my program before #include "winbgim.h":

#define _WINDOWS_H

--efn
jrobinson3k1Author Commented:
I must of got an edited version of winbgim.h somehow, because right above the color declarations is #define _WINDOWS_H. I took that like out of the header file and atleast I got a few less errors, lol. I included winbgim.h and put void main() and tried to compile and I got these errors:

[Linker Error] Unresolved External '__InitVCL' referenced from D:\BORLAND\LIB\CP32MTI.LIB]crtlvcl
[Linker Error] Unresolved External '__ExitVCL' referenced from D:\BORLAND\LIB\CP32MTI.LIB]crtlvcl
efnCommented:
It looks like it thinks you want to use the Borland Visual Component Library, but you are not linking it in.  Since this is supposed to be a console application, I'd suggest you look for something that is trying to use the VCL and remove it.  If you have a #include <vcl.h> somewhere, you could remove it and see what doesn't compile.  You could look at the project options too.

I hope the fact that you are reporting a linker error means that you got it to compile.

--efn

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jrobinson3k1Author Commented:
it compiles but it does not run. And I can't fine anywhere where the VCL is included since I'm just compiling the include of that header file and thats it. Perhaps its impossible to get winbgim to work on Borland 6? Because I'm fresh out of ideas of what to try.
efnCommented:
Have you tried any of the sample code from the winbgim documentation?
jrobinson3k1Author Commented:
Sorry for the absense, was gone all weekend. Yes, the winbgim.cpp file won't work either. I get the same linker errors.
efnCommented:
I don't know what else to suggest.  For what it's worth, by "sample code," I didn't mean winbgim.cpp, which builds the library itself, but separate sample programs in the documentation.  The one I built was in the documentation on kbhit().

--efn
tinchosCommented:
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: efn {http:#9639880}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.