0

I wanted to learn game dev in C++ lately, so I decided to setup raylib in Visal Studio 2022 by following a tutorial online. I downloaded the latest release from the raylib github repo and configured Additional Directories/Additional Dependencies. raylib.h would successfully show up when I did #include but the issue comes up whenever I use any function:

#include "raylib.h"
int main() {
 InitWindow(1280, 800, "Raylib");
 CloseWindow(); // Exception throws at this line.
 return 0;
}

Error:

Exception thrown at 0x00007FF6A4F896AA in RaylibTest.exe: 0xC0000005: Access violation reading location 0x0000000000000360.

I noticed that there was no raylib.dll in Debug > Windows > Modules which might be the culprit, but I do not know how to fix that.

SecretAgentMan
2,8708 gold badges26 silver badges44 bronze badges
asked Sep 21, 2025 at 7:49
1
  • 4
    This question is similar to: How to link dll in visual studio?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Sep 21, 2025 at 13:10

1 Answer 1

-1

Raylib provides a option to override OpenGL versions used in the options.

answered Sep 21, 2025 at 8:19
Sign up to request clarification or add additional context in comments.

2 Comments

I downloaded the raylib.dll file from the link which is supposed to work on OpenGL 3.1 and less and I replaced the old raylib.dll with the new one alongside my .exe file. It did nothing. This might be the actual issue because my machine supports OpenGL 3.1
Please don't just download random files from the internet and use them in your project. That's stupid and you won't get a portable application that way. You have no way to know what that random thing you downloaded does.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.