cmark-gfm icon indicating copy to clipboard operation
cmark-gfm copied to clipboard

Compile with /MT instead of /MD in MSVC

Open raphasampaio opened this issue 4 years ago • 0 comments

Hey all, I'm compiling cmark-gfm (master) on windows using nmake with x64 Native Tools Developer Command Prompt for VS2019. When I try com link the .lib with my program the VS2019 raise the following error:

1>cmark-gfm_static.lib(map.c.obj) : error LNK2019: unresolved external symbol __imp_bsearch referenced in function cmark_map_lookup 1>(...).exe : fatal error LNK1120: 1 unresolved externals

I read that this error is related to the run-time library, and I saw that the .lib was compiled with MSVCRT

cmark-gfm\build\src>dumpbin /DIRECTIVES  cmark-gfm_static.lib
Microsoft (R) COFF/PE Dumper Version 14.27.29111.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file cmark-gfm_static.lib

File Type: LIBRARY

   Linker Directives
   -----------------
   /DEFAULTLIB:MSVCRT
   /DEFAULTLIB:OLDNAMES

Is there any way to pass an argument to nmake to compile with /MT (LIBCMT)?

raphasampaio avatar Jul 07 '21 20:07 raphasampaio