Thread: Help with the putpixel function.

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    Unhappy Help with the putpixel function.

    I am using the Borland C++ 3.1 (quite old, eh?). Anyway I wish to display some pixels on the screen and I use the putpixel function of the graphics.h library. I only use the function once in the following part of the code:

    if ((z.real)>2)||(z.imag<(-2))){
    putpixel (c.real,c.imag,15);
    continue;
    };

    When I link the code I get a linker error that the _putpixel symbol is undefined in the mandel.cpp module (the filename of my program). I don't seem to understand this error message. I have used the #include <graphics.h> command. I am missing something here? I would appreciate any help.

    P.s.: I am a newbie in C programming, so please excuse me in the possibility that this question is quite silly.

  2. #2
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    As I recall, you've also got to tell the compiler to use the graphics library in addition to including the graphics header. Look at your project, and under options, you should see a check box to include the graphics lib. I don't have the version installed on this computer, or I'd tell you more about it.

    Addiitonally, putpixel is in graphics mode, so you also need to make a call to initgraph(&drivename, &drivermode); Disregard if you've done this already.
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM