Mail Archives: djgpp/1994/03/16/06:56:49
> 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 -