I am Stuck with Raylib error of fatal error: raylib.h: No such file or directory

even after following all instructions of the course “C++ Fundamentals: Game Programming For Beginners”

Hello Kabir,

I have a couple of questions for you:

  1. Where do you have Raylib installed to?
  2. Which build task are you using to build your project?

Hi Kabir,

@Tuomo_T is currently away for a few days but it looks like that the install is in the correct place as its the default location for the install.
It may be related to either the build task you are using to build the game or that the project is inside the users folder. Its been a while since i used raylib but some game engines don’t like having the project inside the users folder. It may be worth trying to make the project outside of that folder by creating a new folder at the root level of the drive and placing the project there.

If this does not help Tuomo may have some other ideas that can help when he gets back

All the best

Do you get the same issue if you go to Terminal > Run Task then click on build debug ?

Now its showing raylib directry not found

That’s because the task you need to use at this point is specifically either build debug (which I recommend) or build release.

Any other option won’t link the raylib source files to your code and to the compiler, as by default the compiler only cares about the specific file you ask to compile, and nothing else.

But I am using build debug only. You can view the screenshot in my previous reply for reference . Could you please provide some kind of other tutorial or method which can help me understand the problem and sort it out.
Screenshot 2024-06-30 114431

Except you’re not, you’re using “C/C++: g++.exe build active file”: This is what I see from your previous screenshot.

And this is what I would expect to see:

Accessed through Terminal > Run Task, which (should, assuming configuration files have not been modified) lead to this:


So far I have tried all the solutions suggested by you like running in terminal , debugging, checking the installation path,etc.
But I am not able to see the option of build release /debug on my VScode.
It looks like you are not able to get what I am trying to convey Could you please add someone senior from your team who could assist me to get the solution.

I have to work on other projects .So,I request GameDev team to help me ASAP So I can purchase new projects and start working on them.

Hi Kabir,

Tuomo has contacted me as the normal steps to troubleshoot this issue seems to not be working for yourself.

I wonder if something has happened with the template itself and you may need to redownload the template and make sure that the file path is C:\Users\kabirzDesktop\vscode-template-main\ and not C:\Users\kabirzDesktop\vscode-template-main\vscode-template-main
I seem to remember when i went through the course this was a source of a major headache for me and also making sure i opened the project from the main.code-workspace file using the right click and open with vscode.

If you could try the above as if the project has not been opened in the correct way then it cannot find raylib or the build tasks.

Tuomo has followed all the correct steps to try and get this working and i appreciate getting stuck when something appearingly should work but doesnt is SUPER frustrating but we will work with you to get you going again.

Please do report back and if you can screenshot what appears when you do the Terminal > Run Task as then we can see what options you have there and it may provide a clue as to what is happening here.


Thanks it worked !

1 Like

Awesome to hear, Glad you have got going again, Sometimes its just a case of going through the process again as i think i made a mistake the first time and had to do it again :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms