Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Trouble including Graphics.hpp to my header file  (Read 215 times)

0 Members and 1 Guest are viewing this topic.

Kamil

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Trouble including Graphics.hpp to my header file
« 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: Trouble including Graphics.hpp to my header file
« Reply #1 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
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything