how to solve codeblocks unable to run a graphics c program properly

后端 未结 2 1574
渐次进展
渐次进展 2021-01-29 13:40

I had setup codeblocks for graphics programming. like I install winbgim file. and done other setup in the codeblocks linker setting. but when I ran a program like this

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-29 14:32

    Download WinBGIm. CLICK TO DOWNLOAD. Downloading from other website may not work.

    Extract it.

    Open info.txt for linker options and more information.

    Copy MinGW folder to your Code::Blocks installation directory. Default Code::Blocks installation directory is C:\Program Files (x86)\CodeBlocks. There will be MinGW folder already. Copying new MinGW folder only adds some library (libbgi.a) and header (winbgim.h, graphics.h) files in that directory. To manually add files, copy graphics.h and winbgim.h files in include folder of your compiler directory which is C:\Program Files (x86)\CodeBlocks\MinGW. And copy libbgi.a to lib folder of your compiler directory.

    Open Code::Blocks. Open Settings >> Compiler >> Linker Settings. Click Add button in link libraries part and browse and select libbgi.a file you just copied to MinGW folder.

    In right part (i.e. other linker options) paste commands –lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

    Click OK.

提交回复
热议问题