Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22246

include SFML Library in VSCode "SFML/Graphics.hpp no such file or directory" gcc

$
0
0

I've seen other question's relating to this and most if not all that I could find have some round about way of getting SFML to compile and run in VSCode I'm hoping that there is a way to simply append the SFML/include directory to the compilers includes this works with the intelliSense code completion and it correctly knows the location of the SFML Library. intelliSense screenshot.(The extra errors you can see in the screenshot disappear when the file is saved).So ultimately what I would like to know or have help with is getting the SFML library to compile and run without the need for the boilerplate from GitHub that seems to be commonly used thank you.

Main.cpp

#include <SFML/Graphics.hpp>int main(){    float windowHeight = 400;    float windowWidth = 400;    sf::RenderWindow window(sf::VideoMode(windowWidth, windowHeight), "Rougelike");    sf::Texture texture;    if (!texture.loadFromFile("res/player-sprite.png"))        return 0;    sf::Sprite sprite;    sprite.setTexture(texture);    while (window.isOpen())    {        sf::Event event;        while (window.pollEvent(event))        {            if (event.type == sf::Event::Closed)            {                window.close();            }        }        window.clear();        window.draw(sprite);        window.display();    }}

This is my c_cpp_properties.json.

{"configurations": [        {"name": "Win32","includePath": ["${default}","A:/SFML-2.5.1/include/**"            ],"defines": ["_DEBUG","UNICODE","_UNICODE"            ],"windowsSdkVersion": "10.0.19041.0","compilerPath": "A:/mingw32/bin/g++.exe","cStandard": "c17","cppStandard": "c++17","intelliSenseMode": "windows-gcc-x86","compilerArgs": ["-I A:/SFML-2.5.1/include/**"]        }    ],"version": 4}

Viewing all articles
Browse latest Browse all 22246

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>