NO

Author Topic: CAN'T INCLUDE GRAPHICS.H  (Read 8855 times)

Parag Dange

  • Guest
CAN'T INCLUDE GRAPHICS.H
« on: July 04, 2005, 10:48:58 AM »
HELLO,
         I AM HAVING PROBLEMS WITH UR COMPILER. I WANT TO RUN A PROGRAM WRITTEN IN TURBO C++ VERSION 3.2 THIS PROGRAM CONTAIN AN INCLUDE FILE CALLED GRAPHICS.H
        UR COMPILER DOESN'T CONTAIN THIS PERTICULAR FILE. AND WHEN GRAPHICS.H FILE IS INCLUDED FROM TC++, COMPILER SHOWS A LOT OF ERRORS THAT CAN'T BE HANDELED BY ME.

         PLEASE HELP ME  :(  :cry:

HOW TO INCLUDE ANOTHER OLD GOOD HEADER FILES FOR USE WITH THIS COMPILER.

I AM SENDING AN ATTACHMENT IN ZIP FORM WHICH CONTAINS 2 FILES, ONE IS IN PDF FORMAT WHICH DESCRIBES THE PROBLEM IN DETAIL & ANOTHER IS GRAPHICS.H

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
CAN'T INCLUDE GRAPHICS.H
« Reply #1 on: July 04, 2005, 11:51:55 AM »
Hi Parag Dange,
Have you considered that Pelles C is NOT a C++ compiler?
This mean that you cannot compile your project if it is a C++ one.
Anyway that include is probably a TC custom header, maybe you can reuse it from TC in another compiler.
Regards.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

tiwag

  • Guest
CAN'T INCLUDE GRAPHICS.H
« Reply #2 on: July 04, 2005, 12:54:18 PM »
in this case the problem is not a CPP feature,
the problem is that the TCC is a DOS compiler and the headers
are not suitable for win32 console programs.

look at function prototype in graphics.h, where the first error#2001 is reported at line number 248:

Code: [Select]
248: void       far _Cdecl arc(int __x, int __y, int __stangle, int __endangle, int __radius);

we don't have far pointers and memory segmentation any longer in win32 fortunately.

@parag dange (what a name ??)
first: stop crying !
use your TCC for your old dos-code programs, or consider porting them to win32, which should not be a problem, if you are not using some dos-specific bios features, and if you wrote these programs really yourself in the past ;-))
and maybe buy a keyboard with a CAPS-lock key  :twisted:

regards, tiwag

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
CAN'T INCLUDE GRAPHICS.H
« Reply #3 on: July 04, 2005, 02:08:23 PM »
Sorry I haven't looked at the attachements.
Anyway the problem is not the far (that is equated to nothing in windows header), but the _Cdecl that is not recognized. The correct form is _cdecl.
If you put at top of your files this line:
Quote
#define _Cdecl _cdecl

The error should go away, but you will not be able anyway to compile your code. This for many reasons, as already explained by tiwag:
- this program IS written under dos and IS a 16 bits program
- pellesC is a 32bits compiler
-  these graphic routines are in a 16bits library (perhaps graphic.lib)
-that lib has been compiled in 16bits (large or huge model I guess)
You cannot link together 16 and 32 bits code. And if you have 32 bits TCC compiled code, it will be in OMF format (while pellesC use COFF format) so you can't use the polink (for now, but Pelle showed interest in OMF conversion), nor the tlink (that doesn't recognize the COFF format). You could use the M$ linker that accept both, or convert the OMF library in COFF.
I don't know what is your skill level in programming, but if you find this not very understandable keep for the Tiwag good advices, continue to use the TCC for old DOS programs and start WIN32 programming with PellesC that is a very good 32bits C compiler (thankyou again Pelle).  
(About COFF and OMF you'll find discussions on this forum).
Regards
F.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide