#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Question Simple c graphics problem


    #include<stdio.h>
    #include<graphics.h>
    #include<conio.h>
    #include<stdlib.h>
    main()
    {
    int gd=DETECT,gm,x,y;

    initgraph(&gd,&gm,"C:\TurboC++\Disk\TurboC3\BGI");
    x=getmaxx();
    y=getmaxy();
    setcolor(WHITE);
    rectangle(x/30,y/20,x/5,y/4);
    outtextxy(x/30+15,y/8+5,"rectangle");

    getch();
    closegraph();
    restorecrtmode();
    return 1;
    }
    ON COMPILING:
    WARNING:
    unknown escape sequence '\T'
    unknown escape sequence '\D'

    ERROR:
    i> cannot find -lobjc
    2> ID returned exit 1 status

    i've already included header file and library file in DEV compiler.

    please , tell how to remove this error.
    also, ID returned exit 1 status does not affected by return 0 of main().
    THANKS!!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    12
    Rep Power
    0
    i think you have to recall the basic syntax of c string statements.have you came across the escape sequences.try to google about it.if and only if we type "\\"the compiler will take it as a single backslash. so use "c:\\turbo\\bla bla bla"in the initgraph function.so it will avoid the compiler to confuse with the escape seq
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    2
    Rep Power
    0

    Exclamation error un solved


    Originally Posted by s_1_th97
    i think you have to recall the basic syntax of c string statements.have you came across the escape sequences.try to google about it.if and only if we type "\\"the compiler will take it as a single backslash. so use "c:\\turbo\\bla bla bla"in the initgraph function.so it will avoid the compiler to confuse with the escape seq

    thanks!! s_1_th97
    i tried it but of no avail . it give the same error in devcpp :
    cannot find -lobjc and id returned exit 1 status.
    but in dosbox(turboc) , on compiling no error but whenever i run
    it , in message box there is statement saying ....LINKING source..
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    159
    Rep Power
    19
    Do you realize that BGI stands for Borland Graphic Interface? And do you understand that to use this interface you need a Borland compiler? Dev-C++ is not a Borland based compiler.

    Jim
  8. #5
  9. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    Originally Posted by jimblumberg
    Do you realize that BGI stands for Borland Graphic Interface? And do you understand that to use this interface you need a Borland compiler? Dev-C++ is not a Borland based compiler.

    Jim
    Dev-C++ is not even a compiler, but rather an IDE that bundles with it the MinGW gcc port. MinGW gcc does have a BGI library, libbgi.a . I've never used it, but I just now looked and it is there.

    Perhaps if OP would have Google'd for doing BGI with MinGW gcc.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2013
    Posts
    12
    Rep Power
    0

    learn gl


    if you want to program it with dev c++ then use open gl.the ide comes with it by default .it does not includes graphics.h file and all lib files for it.if you are satisfied with turbo c,continue with it.and sorry for my irrelevant answer at first because i only saw the code and havn't noticed that you were using dev c++.

IMN logo majestic logo threadwatch logo seochat tools logo