Excuse me, but I'm a newbie.
I have 2 years worth of learning in Borland C++ 5.0 and know a touch of programming in C++ and OOP Programming, as well as file handling.
My main concern in starting this thread, is to humbly ask anyone, to give (PLEASE!) a step-by-step procedure on how to combat the Error: BGI Directive not supported under Windows error. This is with regard to a project for school, and I urgently need to know how to compile with the #^#^$ graphics.h file, so I can proceed with further debugging my code. I'll be grateful if anyone will.
Best wishes,
Me. :mrgreen: :o

Recommended Answers

All 14 Replies

Error: BGI Directive not supported under Windows

seems self-explanetory (sp): unless you compile it as 16 bit DOS or equivalent it isnt going to work. This is a common error in graphics code so dont worry about it! it wont work in a 32 bit program (windows for example) so you will have to use the Windows GUI code or OpenGL/DirectX or any 32 bit graphics library.

Wow, you've been using Borland C++ for 2 years and you still have only "a touch of programming"?

Wow, you've been using Borland C++ for 2 years and you still have only "a touch of programming"?

Uh-huh, sorry. You know what they say, programming is a big ocean. You might say I've learned quite a bit(not a touch, if you find that offensive, woah :o :( ), enough to help me wade through.

This is a common error in graphics code so dont worry about it! it wont work in a 32 bit program (windows for example) so you will have to use the Windows GUI code or OpenGL/DirectX or any 32 bit graphics library.

OK, I've practically seen this on every website, but could someone please give me step-by-step instructions on how to do so, 'coz the 'every website' don't give 'em, and I'm only conversant with the type-compile-execute process, and nothing whatsoever in between (changing linker options, library options, I'm no good at, 'coz I don't know what they are :?: )
Immensely grateful for any help.
Me :mrgreen: :rolleyes:
Oh, and by the way, I use Borland C++ 5.0, NOT the Turbo version, and I work in Windows XP.
Thanks again.

You may first want to look in the manuals for BC5. They're quite complete and contain a lot of information on how to actually use the environment and set all the options...

There's way too much to OpenGL and DirectX to explain it all here, pick up a good tutorial (I love books ;)) and work through that. Libraries have been written full on the subject but you will want to start small.

Well...gee..uh...thanks...that flew right over my head. :!:
In a previous (though locked) thread (yup...here), one of the guys said "Change the linked options to dos". Now I assume that's for Turbo C++.
I repeat my question, could someone, please, try and break down in English, the step-by-step procedure to make BGI Graphics supportable in Windows? Please? Could someone give me the Windows equivalent of the above tip?
Thanks for your quick replies though. I appreciate it.
Have yourself a merry little Christmas.
Me. :mrgreen: :rolleyes: :p ;) (gotta love those emoticons)

if you had read that other thread you'd have understood that you can NOT use BGI graphics under Windows.
It's specifically DOS ONLY.

It just turned Christmas half-an-hour ago!
HAPPY LORD JESUS' 2004th BIRTHDAY ANNIVERSARY!
HAPPY KRIS KRINGLE DAY!


OK, I'm getting desperate. Thanks for your help, jwenting, but could you (or someone) please tell me how to compile-edit-execute in Borland C++ in DOS Mode? I mean, do you have to use the Command Prompt, or something? How do you 'change the linker options to DOS' in Windows XP, when there's no Borland C++ equivalent to do it? Please help. Need help. The bgidemo.c file works on my compu, why not the rest I'm trying to make?


Keep in mind, I'm a newbie.


Once again, HAPPY WEEK BEFORE NEW YEAR'S!
Me :mrgreen: :rolleyes: :)

have a look in the manual. It should be an option (command line) for the LINKER / COMPILER. something like a 16bit or a DOS flag. DJGPP compiles 16 bit code perfectly, although you would have to use THEIR graphics lib, which i think it not too hard

BC5 can compile 16 bit Windows programs just fine. Not sure about DOS programs though.
16 bit Windows doesn't support BGI.

Thanks, but either I'm just stupid, or I'm still wading.

int graphdriver = VGA;
   int graphmode = VGAHI;
   int graphicerr = 0;
   //Directory for BGI Drivers
   char driverpath[]="C:\BC5\BGI";
   initgraph(&graphdriver, &graphmode, driverpath);
   graphicerr = graphresult();
   if(graphicerr!=gr0k)
   {
   	status("Error in Graphics Display. Consult your computer technician for details.");
      exit(0);
   }

Here's the above code I'm trying to use, but it doesn't seem to be working. How do I get to compile it in DOS?
I'm really sorry for taking up your time.
status() is a function, by the way, which accepts strings.
Hope you had a Merry Christmas!
Me. :mrgreen: :rolleyes: :cool: :!: :?:

>How do I get to compile it in DOS?
Are you using DOS? Or are you one of the many ignorant people in the world who think that the Windows command prompt is DOS? You really are behind the times by many years. There are many superior alternatives to BGI these days.

and hardcoding directories into the exe...

He's just hardheaded in the extreme I think, refusing to listen to any advise that tells him he's not going to get what he wants.

Have you tried DJGPP????

1) its free
2) it has a grahics lib
3) its 16 bit DOS
4) almost EVERY tutorial on 16 bit gfx is INLINE ASSEMBLY so you might as well get DJGPP so you can compile the 16 bit asm cleanly.

I'm not hardheaded, I'm just plain stupid.
Thanks for the replies though. I quit Borland. Working with Turbo. It seems to work now.
I hereby deem this forum closed.
Thanks again!
Cheerio, Me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.