SFML community forums

Help => General => Topic started by: Kamil on December 08, 2023, 12:23:31 pm

Title: Trouble including Graphics.hpp to my header file
Post by: Kamil on December 08, 2023, 12:23:31 pm
Hello,
I have big trouble including SFML/Graphics.hpp to my header file inside include/ folder.
It says that:
#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit.
cannot open source file "SFML/Graphics.hpp"

I am working on M1 Macbook with macOS Sonoma 14.0.
I have installed sfml via brew.

I also attach my project structure, sfml version I'm working with and compilation script.

Including path in Microsoft C/C++ Extension didn't help as well.

Any help will be appreciated.
Thank you for your answer in advance
Title: Re: Trouble including Graphics.hpp to my header file
Post by: eXpl0it3r on December 08, 2023, 02:49:41 pm
It's probably because you're not including asdf.h anywhere in the main.cpp or Ball.h file, as such it's not detected as being part of the translation unit (i.e. the compiled C++ source file (main.cpp)).

I highly recommend to install the CMake extension in VS Code and use CMake instead of a makefile.
There's even a great SFML CMake template here: https://github.com/SFML/cmake-sfml-project