OpenGL, C++ and Glut – Using CodeBlocks and MinGW

16 12 2008

I’ve moved! – My new website is at www.deannicholls.co.uk and is updated with my latest projects, tutorials and general bloggy goodness 🙂

This tutorial seems to have helped a lot of people so I’ve updated it (as of 18/06/2010) for Windows 7 and the latest version of CodeBlocks and MinGW.

You can find the new and improved version of this tutorial at:

http://www.deannicholls.co.uk/tutorials/show/cpp_glut

Thanks 🙂


Actions

Information

38 responses

26 12 2008
Jeremy

Thanks Dean for a great tutorial, it was concise and to the point. Exactly what I was looking for. 🙂

9 01 2009
marcel

Hello ,

that’s wonderfull, I like the article, it has been really helpfull for me. That’s why i didn’t hesitated to leave a comment.

Have a nice day

22 01 2009
Ayotunde

thanks a lot man ! 🙂

12 02 2009
karthik

wonderful tutorials

13 02 2009
LQman

thanx dude, this tutorial is very usefull by newbie.

19 02 2009
dINGLE

Great tutorial. Thanks!

22 02 2009
mayur

Hi,
It is just what i was looking for .
Have a nice day !
Thanks!

25 03 2009
Douglas

Great Tutorial, dude! I wonder if there’s a way to automate it.

29 03 2009
malik

seems like a charm… simple and lovely… inshallah/godWilling it will work… my poor old computer doesn’t support that crazy big MS Visual studio and the vc++ express editions is giving me jitters to compile the programs (tons of errors)

30 03 2009
malik

Oh thank you so much…… thanks a lot… i had never been able to set up opengl thanks to those creepy compilers and IDE’s… finally i was able to set it up thanks to such a great tutorial….

10 05 2009
SKumar

Great tutorial for a GLUT beginner like me. Thanks a ton!

10 05 2009
Issam

Thanks 🙂
Needed that for my assignment…

26 05 2009
MikeF

Awesome tutorial. I was gearing up for a big headache of setting up an OpenGL environment… then I find this, and10 minutes later it’s all done! Thanks!!

30 05 2009
kim

omg this tutorial saved me, been cracking my head off coz of other tutorials using glAux that never included anymore. 10/10

1 07 2009
Rathinagiri

Thanks for the tutorial. It is very much useful.

20 07 2009
Jake

You are a genius! I’ve spent months trying to set up OpenGL under windows vista. Thankyou so much!

26 07 2009
To use GLUT or not?

[…] […]

28 07 2009
greg aiken

if i am trying this tutorial WITHOUT codeblocks, but using just the MinGW environment. do you know the exact syntax to tell gcc to compile your test program? thanks in advance…

29 07 2009
codiecode

I’m afraid I’ve never used MinGW as a command line compiler before so I couldn’t say how that’s done. MinGW is a windows version of the Linux GCC compiler so I’d imagine the commands are quite similar. Try searching for tutorials on MakeFiles and GCC/MinGW Command Line Compiling. I’m sorry I couldn’t be of more help.

27 08 2009
Ryan

WOO! Thank you so much – why did it have to be this complicated? Great documentation.

11 09 2009
alexander

Cheers and thank your for a wonderfull guide. It was a tremendous help in getting me started on developement with glut 😉

12 10 2009
malik

Thanks again dude… i used your tutorial again.. it makes such a cryptic process so intuitive..

27 11 2009
independent

Good job, thanks you for article very much!

18 01 2010
jpsrpv20

Hello, i seem to be getting this when i build: “test – Debug” uses an invalid compiler. Skipping…
Nothing to be done.

To make things more weird, everytime I make a project it tells me it cannot be saved because of .

I don’t know what’s going on, but then again when I downloaded glut my “glut.dll” file was named “glut32.dll” I just ignored it and kept going as followed, but I fear this might the root to this mess..

Any help would be appreciated, thank you.

18 01 2010
jpsrpv20

because of this error

18 01 2010
jpsrpv20

its not printing for some reason, sorry

25 02 2010
pretty2wow

Its great!! thanks a lot! but anyway, i face a problem. when i click on ‘Build’, an ‘glut.h’ file opened automatically in the codeblocks with 3 errors. i don’t know why. its so irritating. please help me anyone.

26 02 2010
codiecode

Have another look at how you’re linking in your libraries, check you have them in the order I laid out and in the correct directories. I remember I had this issue once, it was a while ago now though so I’m not 100% on what was causing it. If you find out what is causing it, let me know 🙂

28 02 2010
chu

sorry ya.i want to ask about why thic cannot work in my pc?
everytime i run my project,1 new file named ‘glut.h’ will come out and say there is something wrong with my code?
can u tell me why?
thanks a lot.

8 03 2010
Ashutosh

Great Job Man..!
You solved ALL of my problems, Hats Off 2 u…

30 03 2010
丹泽

Genius! Thx verrrry much ! very Useful tutorials!! Thx again !~~你太棒了!

31 03 2010
blackdiamond89

Thanks very much!

6 04 2010
Matheus Lin

Hey!
Thanks a lot, man! Actually, very precise, indeed. =)
You asked for new operational systems where it worked; I’m on Windows 7 32 and it worked pretty fine. =)

It worked real fast, so.. thanks one more time. =)

24 04 2010
Pbheed

superb tutorial dude!!!

really worked a charm… i had been trying for a month before but couldn’t get it working in codeblocks..
guess i had been looking in the wrong places!!

thanks very much…..
finally got to program glut through code blocks..
thanks!!!

27 04 2010
Jackjack

Thank you so much for this tutorial! By the way when I first tried to build the project it gave me an error: “test1 – Debug uses an invalid compiler. Skipping…” but it turn out i had to go to “Toolchain executables” and change the directory for the compiler because it was set on default as “C:\MinGW” instead of where MinGW was installed to by default which was “C:\Program Files\CodeBlocks\MinGW”. Again, thanks so much for this tutorial, i have been looking for something exactly like this for a while!!!

4 06 2010
Medivh

Thank you so much this was great tutorial, your the bst man!

12 06 2010
shuvo

great tutorial

16 06 2010
cloppol

Thank you so much! From Russia I think it will be interesting for you to listen! 🙂 You’ve helped me a lot! Great explanation man, thanks once again!

Leave a comment