delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/15/07:00:10

To: kunst AT prl DOT philips DOT nl, djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP users list)
From: Mike Piff <M DOT Piff AT sheffield DOT ac DOT uk>
Date: 15 Mar 94 11:27:11
Subject: Re: Graphics and C++
Reply-To: Mike Piff <M DOT Piff AT sheffield DOT ac DOT uk>

%%>From:          kunst AT prl DOT philips DOT nl
%%>>
%%>> I have a program that compilers and runs successfully as a .C program. I
%%>> changed it to a .CC program, and tried -lgr_p as a guess, but then I get
%%>> undefined reference to 'mcount' lots of times.
%%>
%%>You guessed wrong ! The *_p.a libraries are used for profiling.
%%>Try using the normal libraries: -lgr  or  -lgrx
%%>Make sure to have 'extern "C"' statements around your include files
%%>inside your sources to avoid C++ name mangling, just in case...
%%>(Most include files have these already, I assume)
%%>
%%>  #ifdef __cplusplus
%%>  extern "C" {
%%>  #endif
%%>
%%>  #include <graphics.h> (or #include <grx.h>)
%%>
%%>  #ifdef __cplusplus
%%>  }
%%>  #endif
%%>
%%>
%%>>
%%>> Any ideas what I am doing wrong? Also, getkey() isn't accepted any more as a
%%>> statement.
%%>>
%%>
%%>Try: -lpc
%%>

I have tried all these suggestions. Two points.

1) In graphics.h, lines 79-84, Blit appears to be declared twice.
2) Program now compiles, but the graphics is in thin vertical strips, and the
screen is updated several times. (This is in C++, it is file in C.)

Mike Piff

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Dr M J Piff, School of Mathematics and Statistics, University of %%
%% Sheffield, UK.                    e-mail: M DOT Piff AT sheffield DOT ac DOT uk %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

- Raw text -


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