Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97420

Visual studio code #include stopped working

$
0
0

I'm trying to include SDL2 in vscode using c++ on a windows computer but for some reason, it suddenly stopped working.

my code:

#include <iostream>
#include <SDL2/include/SDL.h>

int main(){
    if (0){
        std::cout<<"abc"<<std::endl;
    }
    std::cout<<"Hello world"<<std::endl;
    return 0;
}

my properties.json file:

{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/cppLibraries"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.16299.0",
            "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "msvc-x64"
        }
    ],
    "version": 4
}

I'm getting the error-message:

helloworld.cpp:2:10: fatal error: SDL2/include/SDL.h: No such file or directory
 #include <SDL2/include/SDL.h>
          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

It says the file is missing but it exists in the directory and it used to work.

What have i done wrong and how can i fix it?


Viewing all articles
Browse latest Browse all 97420

Trending Articles



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