Error due to #include

前端 未结 3 1549
自闭症患者
自闭症患者 2020-12-18 00:05

I am trying to compile a program which includes the graphics.h header file for C. I have added the graphics.h and winbgim.h header fil

3条回答
  •  醉梦人生
    2020-12-18 00:35

    If you try to compile the source code with including “graphics.h” in code::blocks IDE you have to setup winBGIm library.

    • Download WinBGIm from http://winbgim.codecutter.org/ or use (direct link)
    • Extract it.
    • Open graphics.h, go to line 302 change int right=0 to int top=0
    • Copy graphics.h and winbgim.h files in include folder of your compiler directory.
    • Copy libbgi.a to lib folder of your compiler directory
    • In code::blocks open Settings >> Compiler and debugger >> linker settings
    • Click Add button in link libraries part, browse and select libbgi.a file
    • In right part (ie. other linker options) paste commands
      -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
    • Click Ok

    You can also check this video tutorial.

提交回复
热议问题