Skip to content

Commit 43adf7b

Browse files
committed
MSVC: link dynamically to the CRT
Dynamic linking is generally preferred over static linking, and MSVCRT.dll has been integral part of Windows for a long time. This also fixes linker warnings for _malloc and _free in zlib.lib, which seems to be compiled for MSVCRT.dll already. The DLL version also exports some of the CRT initialization functions, which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by subsequent Unicode patches). Signed-off-by: Karsten Blees <blees@dcon.de>
1 parent 99df39b commit 43adf7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,16 +1138,16 @@ ifeq ($(uname_S),Windows)
11381138
compat/win32/pthread.o compat/win32/syslog.o \
11391139
compat/win32/poll.o compat/win32/dirent.o
11401140
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
1141-
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
1141+
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE
11421142
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
11431143
PTHREAD_LIBS =
11441144
lib =
11451145
ifndef DEBUG
1146-
BASIC_CFLAGS += -GL -Os -MT
1146+
BASIC_CFLAGS += -GL -Os -MD
11471147
BASIC_LDFLAGS += -LTCG
11481148
AR += -LTCG
11491149
else
1150-
BASIC_CFLAGS += -Zi -MTd
1150+
BASIC_CFLAGS += -Zi -MDd
11511151
endif
11521152
X = .exe
11531153
endif

0 commit comments

Comments
 (0)