From 3a951feb232b4d6e48d86c8f1099561ce0478845 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Sun, 12 Apr 2026 21:01:42 +0200 Subject: [PATCH] Compiling and linking with no problems --- .gitignore | 2 +- .vscode/launch.json | 7 +------ Makefile | 2 +- core | 2 +- src/Makefile | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 655e66e..524b093 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ build -core/* +core diff --git a/.vscode/launch.json b/.vscode/launch.json index b731c82..7eafb39 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,12 +12,7 @@ "args": [], "stopAtEntry": false, "cwd": "${fileDirname}", - "environment": [ - { - "name": "LD_LIBRARY_PATH", - "value": "${workspaceFolder}/build/" - } - ], + "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ diff --git a/Makefile b/Makefile index d0acf39..c8fb162 100644 --- a/Makefile +++ b/Makefile @@ -42,5 +42,5 @@ clean: # Run executable .PHONY: run run: - $(Q)LD_LIBRARY_PATH=$(shell pwd)/build/ ./$(BUILD_DIR)/$(SOURCE_OUTPUT) + $(Q)./$(BUILD_DIR)/$(SOURCE_OUTPUT) diff --git a/core b/core index 5232d44..9282b15 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 5232d446a5dec84ac1d023ff34c36afc34704718 +Subproject commit 9282b15528fe93be763d46a02dbe255968c548d5 diff --git a/src/Makefile b/src/Makefile index 45158fa..0b4b9ec 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,10 +33,9 @@ count_src_build: $(eval export TOTAL_SRC_FILES := $(shell echo $$(($$(make -n $(SOURCE_OBJECTS) 2>/dev/null | grep -c "Building") + 1)))) # Link game target -# The ignore unresolved symbols in shared libs is ugly but works if the core changes. $(BUILD_DIR)/$(SOURCE_OUTPUT): $(SOURCE_OBJECTS) $(BUILD_DIR)/libCore.so @echo -e "[100%] $(YELLOW)Linking $(SOURCE_OUTPUT)$(RESET)" - $(Q)$(SRC_CC) $(SRC_LDFLAGS) $(SOURCE_OBJECTS) -L./$(BUILD_DIR) -lCore -Wl,-unresolved-symbols=ignore-in-shared-libs -o $@ + $(Q)$(SRC_CC) $(SOURCE_OBJECTS) -L./$(BUILD_DIR) $(SRC_LDFLAGS) -lCore -Wl,-rpath,$(BUILD_DIR) -o $@ # Build .o files $(BUILD_DIR)/$(SOURCE_DIR)/%.o: $(SOURCE_DIR)/%.c