Solved

Need help with graphics.h in XP

Posted on 2003-10-23
21
461 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:jrobinson3k1
21 Comments
 
LVL 15

Expert Comment

by:efn
Comment Utility
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
0
 
LVL 1

Expert Comment

by:Paladin_VB
Comment Utility
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 .
0
 

Author Comment

by:jrobinson3k1
Comment Utility
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.
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
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
0
 

Author Comment

by:jrobinson3k1
Comment Utility
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?
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
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
0
 

Author Comment

by:jrobinson3k1
Comment Utility
Well what more do you need to know and I can tell you. Do you have Borland 6 or familar w/ it?
0
 

Author Comment

by:jrobinson3k1
Comment Utility
Is OpenGL like BGI, just more modern for Windows?
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
> 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
0
 

Author Comment

by:jrobinson3k1
Comment Utility
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.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:jrobinson3k1
Comment Utility
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.
0
 

Author Comment

by:jrobinson3k1
Comment Utility
increasing points to 100
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
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
0
 

Author Comment

by:jrobinson3k1
Comment Utility
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
0
 
LVL 15

Accepted Solution

by:
efn earned 100 total points
Comment Utility
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
0
 

Author Comment

by:jrobinson3k1
Comment Utility
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.
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
Have you tried any of the sample code from the winbgim documentation?
0
 

Author Comment

by:jrobinson3k1
Comment Utility
Sorry for the absense, was gone all weekend. Yes, the winbgim.cpp file won't work either. I get the same linker errors.
0
 
LVL 15

Expert Comment

by:efn
Comment Utility
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
0
 
LVL 9

Expert Comment

by:tinchos
Comment Utility
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Quicksort a dynamic deque 33 57
C++ Language error 28 143
Dynamically allocate memory 9 46
computer science syllabus 3 52
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now