Skip to content

Commit

Permalink
🐛 Fix GTK library dependencies and build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
6im0n committed Apr 7, 2024
1 parent 319e616 commit acae72f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ CXXFLAGS = -g -fno-gnu-unique -Wall -Wextra -Werror -std=c++20
CXXFLAGS += -fprofile-arcs
SFML_FLAGS = -lsfml-graphics -lsfml-window -lsfml-system
SDL_FLAGS = -lSDL2 -lSDL2_image -lSDL2_ttf
#GTK_FLAGS = `pkg-config --cflags --libs gtk+-3.0`
VULKAN_FLAGS = -lglfw
NCURSES_FLAGS = -lncurses
INC = -I.
Expand Down Expand Up @@ -163,7 +164,7 @@ $(NAME) : $(OBJ_CORE)
graphicals: $(NAME_NCURSES) $(NAME_SFML) $(NAME_SDL)

%.o: %.cpp
@$(CC) $(INC) $(CXXFLAGS) `pkg-config --cflags --libs gtk+-3.0` -fPIC -c -o $@ $< && \
@$(CC) $(INC) $(CXXFLAGS) $(GTK_FLAGS) -fPIC -c -o $@ $< && \
$(call YELLOW,"🆗 $<") || \
$(call YELLOW,"❌ $<")

Expand All @@ -178,7 +179,7 @@ $(NAME_SFML) : $(OBJ_SFML)
$(call YELLOW,"❌ $@")

$(NAME_SDL) : $(OBJ_SDL)
@$(LINKER) -shared -fPIC `pkg-config --cflags --libs gtk+-3.0` -o $(NAME_SDL) $(OBJ_SDL) $(CXXFLAGS) $(SDL_FLAGS) && \
$(LINKER) -shared -fPIC $(GTK_FLAGS) -o $(NAME_SDL) $(OBJ_SDL) $(CXXFLAGS) $(SDL_FLAGS) && \
$(call YELLOW,"✅ $@") || \
$(call YELLOW,"❌ $@")

Expand Down
8 changes: 4 additions & 4 deletions src/sdl/Sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

#include "Sdl.hpp"
#include "includes/Keys.hpp"
#include <gtk/gtk.h>
#include <map>
// #include <gtk/gtk.h>

Arcade::Sdl::Sdl()
{
gtk_disable_setlocale();
gtk_init(NULL, NULL);
gtk_init_check(NULL, NULL);
// gtk_disable_setlocale();
// gtk_init(NULL, NULL);
// gtk_init_check(NULL, NULL);
SDL_Init(SDL_INIT_EVERYTHING);
this->_window = SDL_CreateWindow("Arcade", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, 725, 899, SDL_WINDOW_SHOWN);
Expand Down
2 changes: 1 addition & 1 deletion src/sdl/Sdl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#pragma once
#include "includes/Keys.hpp"
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>
#include <SDL2/SDL_image.h>
#include <iostream>
#include <memory>
#include <vector>
Expand Down

0 comments on commit acae72f

Please sign in to comment.