diff --git a/Makefile b/Makefile index 544d19a..dab2ec2 100644 --- a/Makefile +++ b/Makefile @@ -21,11 +21,12 @@ ifeq ($(OS), Windows_NT) PLATFORM := win32 PLATFORM_SRCS := $(wildcard $(SRC)/win32_*.c) PLATFORM_OBJS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(PLATFORM_SRCS)) - PLATFORM_FLAGS := -D WIN32 -DUNICODE -D_UNICODE - PLATFORM_LIBS := + PLATFORM_FLAGS := -DWIN32 -DUNICODE -D_UNICODE + PLATFORM_LIBS := -municode -mconsole ifeq ($(CI2_GUI),1) PLATFORM_LIBS += -mwindows + PLATFORM_LIBS -= -mconsole PLATFORM_FLAGS += -DCI2_GUI endif diff --git a/src/win32_ci2.c b/src/win32_ci2.c index e65ca58..d8c954d 100644 --- a/src/win32_ci2.c +++ b/src/win32_ci2.c @@ -25,7 +25,7 @@ SOFTWARE. int WINAPI ci2_wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, - PWSTR pCmdLine, + LPSTR pCmdLine, int nCmdShow) { // Create a console so stdout/stderr work UNUSED(hPrevInstance); @@ -71,7 +71,7 @@ int WINAPI ci2_wWinMain( } int WINAPI ci2_wmain(int argc, ci2_sys_char *wargv[]) { - // You already have a console because this is a console subsystem binary. + wprintf(L"Console present. argc=%d\n", argc); UNUSED(wargv); HINSTANCE hInst = GetModuleHandleW(NULL);