[C / C ] Graphics in Dev-C
Update 24/05/2014: Tested successfully on all systems win 64 and 32 bit.
Use the library and graphics.h winbgim.h
The use of graphics on the dev-C bit difficult compared to when on Turbo C Turbo C allows use even longer dev-C is not, we need some small steps to set up graphics in Dev-C.
Content
Using the library winbgim.h
Using the library graphics.h
Using the library winbgim.h
How to make simple, Just copy the files into the folder is finished.
First you download the necessary files here
After you unzip the downloaded will see a folder “VietSource.net – Graphics in Dev-C” in directory 5 file:
You copy:
– file libbgi.a in directory lib (usually C:\Program FilesDev-CppMinGW32lib)
– file winbgim.h and graphics.h in directory include (usually C:\Program FilesDev-CppMinGW32include)
– 2 file 6-ConsoleAppGraphics.template and file ConsoleApp_cpp_graph.txt in directory Templates (usually C:\Program FilesDev-CppTemplates)
If you use win 64 bit, download the 32 bit on the ordinary settings and copy the files into the directory as above but from C:Program Files (x86)Dev-Cpp…
Next Dev C you boot up, in File->New–>Project…->Console Graphics Application
Save project and you will see the main file content a simple program like this:
/* graphics in Dev-C++ - nguyenvanquan7826 */ #include <winbgim.h> int main(int argc, char *argv[]) { // now, you can run project initwindow(300, 300); // init window graphics setbkcolor(1); // set background cleardevice(); setcolor(14); // set text color outtextxy(50,100,"Graphics in Dev-C++");// print text in window graphics while(!kbhit()) delay(1); // pause screen return 0; }
And immediately you can run it (When you need to keep running the main file).
Using the library graphics.h
You do the same with other library but is winbgim.h graphics.h library copy in C:Program FilesDev-CppMinGW32include. Then create such project and instead declared winbgim.h library, we library declaration graphics.h
Refer: Graphics Programming with C on Linux (Ubuntu)
Document graphics in C: dowload
win 7 64its bit not always run! To pull the new project library to run!
Did not know you copy the library to include the same file? external library file winbgim.h also any other?
Just that alone your file library! But this library file is not supported by text color! For example, setColor(BLACK); will alarm but setColor(1); it was not error! Graphics.h earned his file and reinstalling win but have lost and do not need to copy the file to the project library again! What a pity!@@
😀 Cảm ơn bạn nhé, is not available right font color, but my copy in the library project has yet to be done on the win 64. There must try again.
Thank you for the article!
I've followed your instructions and have used the library “winbgim.h”, but still faltering without add is the “graphics.h”; bother you with my guide.
The graphics themselves are not used to this and did not know any more. You try to search google offline viewing. 😀
Has completed update your offline. Using the system is on win 8 32 bit and 64 bit. Use the library or graphics.h winbgim.h.
Thank you very much!
I've made it. Exactly that can only be used either alone library!
😀 Tất nhiên là vậy. Use this one instead of the other alone. ^^ Who uses both 2 What.
Additional bit her dentist. Not necessarily Dev C installation 32 The new bit is used, Dev C if installed 64 bit, only slightly modified like this is used:
– Instead of copying the files to the path “C:Program Files (x86)Dev-CppMinGW32…” then we copy the file to the path “C:Program Files (x86)Dev-CppMinGW64x86_64-w64-mingw32…”.
– “Mandatory” the compiler must choose “TDM-GCC 4.8.1 32-bit Release” before and then created a new Project.
Thank you. To test try to see how it ^^
Thank you very much! Mình cũng loay hoay mãi.
Đúng là bắt buộc phải để trình biên dịch như bạn nói ^^
s mình cài cái thư viện winbgim.h vào mà không chạy được bạn, it was error g ++ j, visual c ++ whenever there with the dev C antagonistic not so. at its factory installed Visual C ++ r
This one I'm not sure yet.
you have installed antivirus program k? if so, it will run off normal
Star Intelligent follow the steps above and then file-copy / new project… it creates 1 .dev file and 1 file .cpp; to run the program above is ok. but when drained out into the (the tail .cpp reviews) Newspaper press f9 k it out initwindow,… what. That why sir. explained mn
You must open the project with the new dev files ending đk.
Let me ask your Applications, run it, how this error:
C:\Program Files (x86)\Dev-CppMinGW64x86_64-w64-mingw32binld.exe cannot find -lbgi
C:\UsersgoldtDocumentswinbgim1collect2.exe [Error] ld returned 1 exit status
25 C:\UsersgoldtDocumentswinbgim1Makefile.win recipe for target ‘winbgim1.exe’ failed
Maybe due to the mode you do not prepare, you see how to win 64 above offline
it's why I run error :
378 1 c:\program filesdev-cppmingw32includewinbgim.h [Error] unknown type name ‘bool’
379 20 c:\program filesdev-cppmingw32includewinbgim.h [Error] expected ‘;', ',’ or ‘)’ before ‘&’ token
help me fix
Bạn xem cho mình với nó bảo lỗi Source is not compile
C:\Users\aviSHOP\Desktop\Makefile.win recipe for target ‘pp.o’ failed
C:\Users\aviSHOP\Desktop\process_begin CreateProcess(C:\UsersaviSHOPAppDataLocalTempmake4840-1.bat, C:\UsersaviSHOPAppDataLocalTempmake4840-1.bat, …) failed.
C:\UsersaviSHOPDesktopmake (e=5) Access is denied.
you do the steps above but to File -> New -> Project, the dialog box that appears not see Console Graphics Application. You help yourself to!
Make sure that your files to the correct folder and see that win nhé 64 there are 32 bit, download the right version yet lightweight dev-c.
Thank you for your dentist! Section to file into the folder, they must understand to understand and put into place only, For each type of release has a slightly different directory upcoming.
Read more tutorial on your C ++, mình thực lòng biết ơn bạn luôn ấy 🙂
e test ok but when writing 1 or cop 1 Other programs in the error message ” initgraph(&gd, &gm, “C:\\TC\BGI”); is s sir
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/liblibbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/liblibbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/../lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/../liblibbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../liblibbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/liblibbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../..libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/../lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/lib/libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe skipping incompatible c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../libbgi.a when searching for -lbgi
c:\program files (x86)\dev-cppmingw64x86_64-w64-mingw32binld.exe cannot find -lbgi
C:\UsersNGUYEN HUY HOANGPicturesCamera Rollcollect2.exe [Error] ld returned 1 exit status
25 C:\UsersNGUYEN HUY HOANGPicturesCamera RollMakefile.win recipe for target ‘MyProject.exe’ failed
this one so faulty j brothers are wondering can you go
His press run, it opens Makefile.win and being error in this line
$(CPP) $(LINKOBJ) -the $(BIN) $(LIBS)