Install Dev C++ and OpenGL | It Works

preview_player
Показать описание
How to Install the free compiler Dev C++ and the free graphics library OpenGL on Windows 10.

-lglu32 -lglut32 -lopengl32

Replace less than sign with actual less than sign. YouTube prevents me from adding it here.

---C Code---
#include "LESS THAN SIGN" stdio.h "GREATER THAN SIGN"
int main()
{
printf("Hello World!!!\n\n");
system("pause");
}

---OpenGL Code---
#include "LESS THAN SIGN" GL/glut.h "GREATER THAN SIGN"
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,0,0);
glBegin(GL_POLYGON);
glVertex2f(100,300);
glVertex2f(100,100);
glVertex2f(200,100);
glVertex2f(200,300);
glEnd();
glFlush();
glutSwapBuffers();
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(640,640);
glutCreateWindow("OpenGL");
glutDisplayFunc(display);
gluOrtho2D(0,640,0,640);
glClearColor(0.5,0.7,0.5,0);
glutMainLoop();
return 0;
}
Рекомендации по теме
Комментарии
Автор

I have to say, from the bottom of my heart, thank you much!!!!You saved my day! ;)

Monika
Автор

Just a note for people using this to start a project... something in chrome prevents the glutming download, I imagine it is my adblocker. I was able to download immediately in Microsoft Edge.

Mikevmaestro
Автор

Thanks for the link to this version of devc++. The bloodshed one is broken for me on Windows 11 but the one you linked works perfectly. It's sad that such a basic and helpful educational tool as devc++ seems to have fallen into disrepair with nothing to replace it.

NelsonBilling
Автор

If you don't see a "SysWow64" folder, that means that you have a 32 bit operating system and use the "system32" folder instead.

DSage
Автор

And when i was completly disappointed you came and made all of this work out as it should be thanks

ardeshirojan
Автор

Oh my
Thank you very much!
There are no simple tutorials like this on the whole internet!

MaxoelRibeiro
Автор

I've followed every step you showed in the video above and it really worked...thank you so much!!!

tamtamns
Автор

After searching for hours over the Internet and tried numerous other non-working solutions, I confirm that this one works on Windows 10 64bit! Thank you 3DSage.
Notice: You don't need to add the commands "-lglu32 -lglut32 -lopengl32" in the compiler options. You only have to click "Project/Project Options/Parameters", place the cursor in the Linker's white-box, press the "Add Library or Object" button, navigate to the "lib" folder found under "C:\Program Files (x86)\Dev-Cpp\MinGW32\lib" and set:

../lib/libopengl32.a
../lib/libglu32.a
../lib/libglut32.a

dmmat
Автор

Thank you so very much! I've been trying other tutorials all day long. Only yours worked.

JoseBatista-yxsh
Автор

wow this actually worked I thought this was going to be out of date

michaelcraft
Автор

the "-l" options should be added to the linker section as they are link time options. in a single file setup both option lists will be fed to the same single compiler command line - but when you have multiple files then this will be different and then its likely to fail. ;-)

alexanderstohr
Автор

Finally, after 3 hours I now have a red rectangle!

lead
Автор

its not working for me, it can find the the 'GL/glut.h' file. I tried with only 'glut.h', but when i did so, all the functions had an undefined reference. And my Dev has an 'MinGW64' folder instead of a 'MinGW32', does that interfere with the result?

lemonjuice
Автор

Reading the description, I blindly followed this amendment step for win7
`If you have 32bit Windows 7, I believe you add the glut32.dll to the system32 folder.`
without realising it said 32bit and I got some error return code at the gl phase.
Moved it to the proper folder and now it works :D

scarlettwhyte
Автор

Thanks, for saving me from hours and hours of crunches.

satishkumarpatra
Автор

It's finally working! I also managed to get it to build and debug in vscode ^^ (plus IntelliSense)

betadata
Автор

still not solved i have got linker error

shaikhzoyeb
Автор

Followed all the steps still getting:
[Error] GL/glut.h: No such file or directory

manthankhandale
Автор

Alhamdulillah thank you so much you have save my degree life :')

nurinsyazwana
Автор

If this works on Windows 10, please comment below and let us know. Thank you!

DSage