Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSYS2 OpenGL Setup

Tags:

opengl

msys2

I am trying to wite OpenGL on MSYS2. I installed mingw-w64 packages like SDL2, glew, glm, mesa etc. But when I try to compile something like;

    gcc main.c -o main -lSDL2 -lGLEW -lGLU -lGL

This is how I compiled things on Linux so i thought it would be similar. but -lGL is giving me problems. I can't find any OpenGL library for MSYS2. I installed mesa as i said but no luck. Should I use Windows version coming with driver and link to that? I don't know how can I do this though.

I copied OpenGL32.dll and lib files from my Windows to mingw64/lib folder and renamed them to libGL but of course this did not work.

like image 525
meguli Avatar asked Apr 15 '26 02:04

meguli


1 Answers

If I remember correctly, on Windows these libraries are called differently.

Try -lglew32 -lglu32 -lopengl32.

like image 92
HolyBlackCat Avatar answered Apr 19 '26 06:04

HolyBlackCat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!