-3

Is There a way to include graphics.h library in Codelite? I don't want to use CodeBlocks or Devc++. I need it for my university project. I know how to include it in CodeBlocks and Devc++ but there are a lot of errors when I use my old code I Wrote in Codelite. screenshot_screenshot

genpfault
  • 51,148
  • 11
  • 85
  • 139
Alireza Fa
  • 131
  • 6
  • Download it as described [here](http://geekhackers.blogspot.co.il/2013/08/how-to-include-graphicsh-in-codeblocks.html). Then tinker with your project to make sure its linked. – StoryTeller - Unslander Monica Jan 24 '17 at 08:26
  • 1
    That library is ancient and outdated. Why do you want it? – Some programmer dude Jan 24 '17 at 08:31
  • @Someprogrammerdude - Some schools still insist on teaching with it. Sad but true. The OP seems to want a modern IDE despite the silly requirement. – StoryTeller - Unslander Monica Jan 24 '17 at 08:45
  • @StoryTeller I added it in linker>libraries in Codelite.I copied the libraries to the compiler directory.I added these-lbgi -lgdi32-lcomdlg32-luuid-loleaut32-lole32 in linker option.It Still isn't working. – Alireza Fa Jan 24 '17 at 08:54
  • paste the errors here ... – theadnangondal Jan 24 '17 at 08:59
  • @theadnangondal the errors I get using codeblocks and devc++ can be fixed but I need to change a lot of things.I just want to make graphics.h work in codelite.when I include it I get no errors but It doesn't do anything. – Alireza Fa Jan 24 '17 at 09:05
  • @AlirezaFa the thing is we cannot really do anything unless we have something to see ... Attach some screenshots or something so that we can atleast have an idea what might be the issue ... Are u sure libraries are getting linked properly ? – theadnangondal Jan 24 '17 at 09:09
  • @theadnangondal I don't know.I added screenshots – Alireza Fa Jan 24 '17 at 09:30

1 Answers1

0

Interesting... This worked for me

I wrote a small program

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


int main()
{ 
   int x = 320, y = 240, radius;
 
   initgraph();
 
   for ( radius = 25; radius <= 125 ; radius = radius + 20)
      circle(x, y, radius);
 
   getch();
   return 0;
}

and compiled it. It created a binary in the Debug folder named 'project'. When I run it by double clicking it does not show anything. So

1) I opened cmd
2) dragged the binary into it.. It saved me the time to type the path myself
3) Pressed enter
4) Does not work the first time
5) Pressed a key to come back to prompt
6) Pressed up key to execute the binary again and pressed enter
7) Did step 6 on the other display and it worked !!!

I know this is not a solution but still a starting point....

EDIT: I have a dual display and when I take the cmd prompt to one display it works and on the other it doesnt work... Probably it has something to do with the display parameters but I am not sure...

enter image description here

Community
  • 1
  • 1
theadnangondal
  • 1,546
  • 3
  • 14
  • 28