#include "raylib.h"

I installed raylib at default location(C:\raylib). When I open up the main at D:\CourseCpp\AxeGame and made my axe_game.cpp with #include “raylib.h”. Then I get “‘raylib.h’ file not foundclang(pp_file_not_found)” I also tried Run build task and this was the result: * Executing task in folder AxeGame: C:/raylib/w64devkit/bin/mingw32-make.exe RAYLIB_PATH=C:/raylib/raylib PROJECT_NAME=axe_game OBJS=*.cpp BUILD_MODE=DEBUG

mingw32-make axe_game
make[1]: Entering directory ‘D:/CourseCpp/AxeGame’
g++ -o axe_game *.cpp -Wall -std=c++14 -D_DEFAULT_SOURCE -Wno-missing-braces -g -O0 C:/raylib/raylib/src/raylib.rc.data -I. -IC:/raylib/raylib/src -IC:/raylib/raylib/src/external -L. -LC:/raylib/raylib/src -LC:/raylib/raylib/src -lraylib -lopengl32 -lgdi32 -lwinmm -DPLATFORM_DESKTOP
make[1]: Leaving directory ‘D:/CourseCpp/AxeGame’

  • Terminal will be reused by tasks, press any key to close it.

Thank you in advance.

Ok, so it looks like what’s happening is that your project is able to compile (that’s what the output in the terminal indicates, as there are no actual errors shown). However, the “intellisense” feature in VS Code is not playing along and thinks it can’t find raylib.

This sometimes occurs, while I understand it can be frustrating so long as your code compiles you can ignore that error. (this is actually how you confirm if it’s intellisense or an actual problem with your code).

What might be contributing to the confusion is that you seem to have both a .vs and .vscode folder in your project. You should be able to delete the .vs folder safely.

Launched the project with VS as well by mistake thats why I had both :slight_smile:

Okey, is there some way to fix this? Since red line screams that something is wrong in my head(and probably many other). Cause it also happens when I use stuff like “InitWindow”. As you said, its working, but its confusing to look at. Thank you :slight_smile:

image

You can try adding the install path of Raylib to your path in environment variables to see if that resolves the problem. Overall it’s a bug with VS Code and Intellisense so there’s not much I can suggest until they resolve it.

Would that be C:\raylib I add then? Or is it C:\raylib\raylib

UPDATE: Tried both, did not work. Thank you for the help :slight_smile:

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

Privacy & Terms