delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/16/06:56:49

From: Paul Harness <gapa83 AT udcf DOT gla DOT ac DOT uk>
Subject: Re: Graphics and C++
To: M DOT Piff AT sheffield DOT ac DOT uk
Date: Wed, 16 Mar 1994 11:06:47 +0000 (GMT)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)

> The following file does not compile for me. I include my environment and also
> the output of gcc.
> 
> Mike Piff
> 
> 
> TEST.CC
> 
> #ifdef __cplusplus
> extern "C" {
> #endif
> 
> #include <stdlib.h>
> #include <stdio.h>
> #include <graphics.h>
> 
> #ifdef __cplusplus
> }
> #endif
> 
> main()
> {}
> 
You don't need the extern "C" statements here as they are already
included in the include files. Try compiling:

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

main()
{
	GrSetMode(GR_default_graphics);
	GrLine(0,0,GrMaxX(),GrMaxY(),GrWhite());
	getkey();
	GrSetMode(GR_default_text);
	return 0;
}

with gcc -Wall filename.cc -lgpp -lm -lpc


-- 
Paul Harness,                        |  Internet: gapa83 AT udcf DOT gla DOT ac DOT uk
Department of Physics and Astronomy, |
University of Glasgow,               |  Tel +44-41-339-8855 ext 8359
Glasgow, G12 8QQ, SCOTLAND.          |  Fax +44-41-334-9029

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019