Undefined symbol in Borland C++ 3.1

I'm trying to do some easy graphics but I'm not understanding this error I keep getting.  First off, the program works fine in my old Borland C compiler (it came on a single disk in a textbook, a limited version 2.0 I think...) so I know the code is error free.  I've installed Borland C++ 3.1 because the IDE is more _modern_ believe it or not!  Here's the program, what little there is, and the errors follow...

#include <stdio.h>
#include <graphics.h>

void main( void )
      int graph_driver;
      int graph_mode;
      graph_driver = VGA;
      graph_mode = VGAHI;  

      initgraph( &graph_driver, &graph_mode,"c:\\borlandc\\bgi" );



Linker Error: Undefined symbol _initgraph in module ..

Linker Error:  Undefined symbol _putpixel in module ..

Like I said it works fine in my very old compiler, its just in the C++ 3.1 compiler in which it fails.  I copied the egavga.bgi file to the directory with the source code so I don't think that's the problem.  I'm thinking maybe I haven't set up the compiler correctly (?)  I don't know since this is the only real one I have.  If anyone can tell me why its giving me undefined symbol errors and how I can fix them (in normal speak, I'm still learning the lingo) I've added a massive amount of points.  Thanks in advance!
Who is Participating?
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.


Check for the include directories under the Options menu item.
Check for the graphics.h file.

Hope this helps
You need to link with the graphics library. bgi.lib? or graphics.lib?
You must add in you project file
For this
1.Open Project Window: Alt + W, P
2. Press INS  
3. Type C:\borlandc\lib\graphics.lib
  in Name (or chouse from list)
4. Enter
5. Translate, make

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
claycombAuthor Commented:
Thanks Alex you led me to what was wrong, I probably wouldn't have found it otherwise so I'll give you the points real quick.  It seems that the Linker didn't have Graphics Library included.  (That's just how the IDE installed on my machine by default, I don't know why...)  Im just wondering though, before I award and finish off this question, if you (or anyone else) can explain why I have to adjust settings in the Linker.  Why isn't it enough to just have #include and give it a header file.  I have the location of the include files set correctly in the program preferences so why isn't this enough in itself?  Why would you want the linker to NOT include graphics files, that option doesn't make any sense to me.  I'm trying to understand _why_ this happens and not just _how_.
This depends of you setting.
By default,  graphics.lib not linked(and i 've described you metod, how you can add every .lib file). If you
want change setting, make this:
1. Alt + O(options), Linker, Libraries.
2. You see in Libraries SubWindow
  Graphics Library
  Turbo Vision.
Set flag in  Graphics Library
and Borland automtically find graphics.lib (and you must delete
graphics.lib from project file:
Alt + W, P, set line to this item
and press Del)
Why by default this flag not set?
Hard speak instead of Borland teem,
but may be they think as:
Most of programms with BC 3.1 in DOS
don't use graphics! In this case
graphics.lib is only unutile addition
in exe file, get place and don't make
nothing. And not every programmist changes default settings.
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

From novice to tech pro — start learning today.