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

Link against SDL_gfx library using makefile? [closed]

$
0
0

I am using visual studio code and i want to add the SDL_gfx library in my project. (I used homebrew to install it on my mac)

There is a file that contains all my includes but when i try to include SDL_gfxPrimitives.h:

#include <SDL.h>
#include <SDL_image.h>
#include <SDL_gfxPrimitives.h>

I have :

sdl2.h:3:10: fatal error: 'SDL_gfxPrimitives.h' file not found

Here is my vscode config:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/local/Cellar/sdl2_image/2.0.5/include/SDL2/*",
                "/usr/local/Cellar/sdl2/2.0.10/include/SDL2/*",
                "/usr/local/Cellar/sdl_gfx/2.0.26/include/SDL/*"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks",
                "/usr/local/Cellar/sdl2_image/2.0.5/include/SDL2/*",
                "/usr/local/Cellar/sdl2/2.0.10/include/SDL2/*",
                "/usr/local/Cellar/sdl_gfx/2.0.26/include/SDL/*"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

I suspect having something missing in my makefile since its the first time im using CFLAGS and LDFLAGS, i'm not sure on how it works:

CC = gcc
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
CFLAGS = -Wall -Wextra `sdl2-config --cflags`
LDFLAGS = -lSDL2_image `sdl2-config --libs`
EXEC = circles

$(EXEC): $(OBJS)
    $(CC) $^ $(LDFLAGS) -o $(EXEC)

%.o: %.c
    $(CC) $< $(CFLAGS) -c -o $@

.PHONY: clean

clean:
    rm -f $(OBJS) $(EXEC)

Viewing all articles
Browse latest Browse all 99601

Trending Articles