diff --git a/Makefile b/Makefile index 21856129..5e0ab752 100644 --- a/Makefile +++ b/Makefile @@ -856,7 +856,7 @@ ifeq ($(TARGET_N64),1) endif ifeq ($(WINDOWS_BUILD),1) - LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static + LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static -mconsole ifeq ($(CROSS),) LDFLAGS += -no-pie endif diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c index 625a0cb6..58b25324 100644 --- a/src/pc/pc_main.c +++ b/src/pc/pc_main.c @@ -338,12 +338,10 @@ int main(int argc, char *argv[]) { #if defined(_WIN32) || defined(_WIN64) // Handle Windows console - if (gCLIOpts.Console && AllocConsole()) { - FILE* fDummy; - freopen_s(&fDummy, "CONOUT$", "w", stdout); - freopen_s(&fDummy, "CONOUT$", "w", stderr); - freopen_s(&fDummy, "CONIN$", "r", stdin); + if (!gCLIOpts.Console) { + FreeConsole(); } + #endif // Create the window straight away