为什么我不能与Visual Studio 2015年RC命令行工具来构建Vim的? [英] Why am I not able to build Vim with Visual Studio 2015 RC command line tools?
问题描述
昨天,我安装了的Visual Studio 2015年RC社区版。作为第一个测试,我试图从源代码构建gVim的。
我打开使用C命令窗口:\\ ProgramData \\微软\\ WINDOWS \\开始菜单\\程序\\的Visual Studio 2015 \\ Visual Studio工具\\ Windows桌面命令提示符\\ VS2015的x64本机工具命令提示符。 LNK
,设置
集包括=%包含%; C:\\ Program Files文件(x86)的\\微软的SDK \\ WINDOWS \\ v7.1A \\包含
Make_mvc。麦
拿起 Win32.mak
文件。另外,我设置:
设置MSVCVER = 12.0
作为使文件呢在这一点上没有检测到新的Visual Studio版本。
在此之后,我有:
Framework40Version = V4.0
FrameworkDir = C:\\ WINDOWS \\ Microsoft.NET \\ Framework64
FrameworkDIR64 = C:\\ WINDOWS \\ Microsoft.NET \\ Framework64
FrameworkVersion = v4.0.30319
FrameworkVersion64 = v4.0.30319
FSHARPINSTALLDIR = C:\\ Program Files文件(x86)的\\微软的SDK \\ F#\\ 4.0 \\框架\\ V4.0 \\
INCLUDE = C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\包括:C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\ ATLMFC \\包括:C:\\ Program Files文件(x86)的\\ Windows下套装\\ 10 \\\\包括\\ 10.0.10056.0 \\ ucrt; C:\\ Program Files文件(x86)的\\的Windows套件\\ 8.1 \\ \\包括共享; C:\\ Program Files文件(x86)的\\的Windows套件\\ 8.1 \\包括\\微米;ç :\\ Program Files文件(x86)的\\的Windows套件\\ 8.1 \\包括\\的WinRT ;; C:\\ Program Files文件(x86)的\\微软的SDK \\ WINDOWS \\ v7.1A \\包含
LIB = C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\ LIB \\ AMD64; C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\ ATLMFC \\ LIB \\ AMD64; C:\\ Program Files文件( 86)\\的Windows套件\\ 10 \\\\的lib \\ 10.0.10056.0 \\ ucrt \\ 64; C:\\ Program Files文件(x86)的\\的Windows套件\\ 8.1 \\ lib目录\\ winv6.3 \\恩\\ 64;
LIBPATH = C:\\ WINDOWS \\ Microsoft.NET \\ Framework64 \\ v4.0.30319; C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\ LIB \\ AMD64; C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\ ATLMFC \\ LIB \\ AMD64; C:\\ Program Files文件(x86)的\\ Windows下Kits\\8.1\\References\\CommonConfiguration\\Neutral;\\Microsoft.VCLibs\\14.0\\References\\CommonConfiguration\
eutral;
MSVCVER = 12.0
平台= X64
PROCESSOR_ARCHITECTURE = AMD64
UniversalCRTSdkDir = C:\\ Program Files文件(x86)的\\的Windows套件\\ 10 \\
VCINSTALLDIR = C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ VC \\
VisualStudioVersion = 14.0
VS100COMNTOOLS = C:\\ Program Files文件(x86)的\\微软的Visual Studio 10.0 \\ Common7 \\工具\\
VS110COMNTOOLS = C:\\ Program Files文件(x86)的\\微软的Visual Studio 11.0 \\ Common7 \\工具\\
VS120COMNTOOLS = C:\\ Program Files文件(x86)的\\微软的Visual Studio 12.0 \\ Common7 \\工具\\
VS140COMNTOOLS = C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ Common7 \\工具\\
VSINSTALLDIR = C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\
WINDIR = C:\\ WINDOWS
WindowsSdkDir = C:\\ Program Files文件(x86)的\\的Windows套件\\ 8.1 \\
WindowsSDK_ExecutablePath_x64 = C:\\ Program Files文件(x86)的\\微软的SDK \\ WINDOWS \\ v8.1A \\ BIN \\ NETFX 4.5.1工具\\ 64 \\
WindowsSDK_ExecutablePath_x86 = C:\\ Program Files文件(x86)的\\微软的SDK \\ WINDOWS \\ v8.1A \\ BIN \\ NETFX 4.5.1工具\\
我能够构建一个简单的程序:
C:\\ ... \\ TEMP>类型T.C
#包括诠释主要(无效){
的printf(%s您好\\ n,Stackoverflow.com);
返回0;
}C:\\ ... \\ TEMP> CL T.C
微软(R)C / C ++优化编译器版本19.00.22816用于基于x64
版权所有(C)微软公司。版权所有。T.C
微软(R)增量链接器版本14.00.22816.0
版权所有(C)微软公司。版权所有。/out:t.exe
t.objC:\\ ... \\ TEMP> t.exe
你好Stackoverflow.com
然而,当我发出命令来构建我的gVim的(东西与Visual Studio 2013工具CE正常工作),编译去罚款,但我得到以下链接错误:
C:\\ ... \\ VIM \\ SRC> NMAKE -f Make_mvc.mak CPU = AMD64 OPTIMIZE = SPACE的gettext =无NETBEANS =没有cscope的=没有DIRECTX = YES GUI = YES
因为有很多人,我最剪断的错误消息
gui_dwrite.obj:错误LNK2001:无法解析的外部符号memcmp
blowfish.obj:错误LNK2001:无法解析的外部符号memcmp
crypt.obj:错误LNK2001:无法解析的外部符号memcmp
sha256.obj:错误LNK2001:无法解析的外部符号memcmp
undo.obj:错误LNK2001:无法解析的外部符号memcmp
blowfish.obj:错误LNK2019:在功能bf_e_cblock引用解析的外部符号的memcpy
winclip.obj:错误LNK2001:无法解析的外部符号的memcpy
screen.obj:错误LNK2001:无法解析的外部符号的memcpy
sha256.obj:错误LNK2001:无法解析的外部符号的memcpy
gui.obj:错误LNK2001:无法解析的外部符号的memmove
gui_w32.obj:错误LNK2001:无法解析的外部符号的memmove
tag.obj:错误LNK2001:无法解析的外部符号的memmove
term.obj:错误LNK2001:无法解析的外部符号的memmove
ui.obj:错误LNK2001:无法解析的外部符号的memmove
undo.obj:错误LNK2001:无法解析的外部符号的memmove
screen.obj:错误LNK2001:无法解析的外部符号的memmove
search.obj:错误LNK2001:无法解析的外部符号的memmove
spell.obj:错误LNK2001:无法解析的外部符号的memmove
syntax.obj:错误LNK2001:无法解析的外部符号的memmove
os_mswin.obj:错误LNK2001:无法解析的外部符号的memmove
os_win32.obj:错误LNK2001:无法解析的外部符号的memmove
quickfix.obj:错误LNK2001:无法解析的外部符号的memmove
regexp.obj:错误LNK2001:无法解析的外部符号的memmove
misc2.obj:错误LNK2001:无法解析的外部符号的memmove
normal.obj:错误LNK2001:无法解析的外部符号的memmove
ops.obj:错误LNK2001:无法解析的外部符号的memmove
option.obj:错误LNK2001:无法解析的外部符号的memmove
memline.obj:错误LNK2001:无法解析的外部符号的memmove
menu.obj:错误LNK2001:无法解析的外部符号的memmove
message.obj:错误LNK2001:无法解析的外部符号的memmove
misc1.obj:错误LNK2001:无法解析的外部符号的memmove
getchar.obj:错误LNK2001:无法解析的外部符号的memmove
hashtab.obj:错误LNK2001:无法解析的外部符号的memmove
mark.obj:错误LNK2001:无法解析的外部符号的memmove
...
misc2.obj:错误LNK2001:无法解析的外部符号FWRITE
spell.obj:错误LNK2001:无法解析的外部符号FWRITE
edit.obj:错误LNK2019:在功能ins_ctrl_ey引用解析的外部符号的字符isalnum
regexp.obj:错误LNK2001:无法解析的外部符号的字符isalnum
ui.obj:错误LNK2001:无法解析的外部符号函数strncpy
gui_w32.obj:错误LNK2001:无法解析的外部符号函数strncpy
libXpm.lib(parse.obj):错误LNK2001:无法解析的外部符号函数strncpy
libXpm.lib(data.obj):错误LNK2001:无法解析的外部符号函数strncpy
regexp.obj:错误LNK2001:无法解析的外部符号函数strncpy
screen.obj:错误LNK2001:无法解析的外部符号函数strncpy
...
main.obj:错误LNK2001:无法解析的外部符号关闭
memfile.obj:错误LNK2001:无法解析的外部符号关闭
libXpm.lib(parse.obj):错误LNK2001:免费解析的外部符号
libXpm.lib(hashtab.obj):错误LNK2001:免费解析的外部符号
libXpm.lib(data.obj):错误LNK2001:免费解析的外部符号
libXpm.lib(misc.obj):错误LNK2001:免费解析的外部符号
...
eval.obj:错误LNK2001:免费解析的外部符号
misc2.obj:错误LNK2001:免费解析的外部符号
os_win32.obj:错误LNK2001:免费解析的外部符号
gui_w32.obj:错误LNK2001:免费解析的外部符号
LIBCMT.LIB(new_scalar.obj):错误LNK2001:无法解析的外部符号的malloc
libXpm.lib(simx.obj):错误LNK2001:无法解析的外部符号的malloc
eval.obj:错误LNK2001:无法解析的外部符号的malloc
misc2.obj:错误LNK2001:无法解析的外部符号的malloc
os_win32.obj:错误LNK2001:无法解析的外部符号的malloc
gui_w32.obj:错误LNK2001:无法解析的外部符号的malloc
normal.obj:错误LNK2001:无法解析的外部符号的realloc
regexp.obj:错误LNK2001:无法解析的外部符号的realloc
libXpm.lib(simx.obj):错误LNK2001:无法解析的外部符号的realloc
eval.obj:错误LNK2001:无法解析的外部符号的realloc
memline.obj:错误LNK2001:无法解析的外部符号的realloc
misc1.obj:错误LNK2001:无法解析的外部符号的realloc
misc2.obj:错误LNK2001:无法解析的外部符号的realloc
...
ex_docmd.obj:错误LNK2001:无法解析的外部符号stricmp
ops.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
option.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
search.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
spell.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
fold.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
getchar.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
main.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
mark.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
eval.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
ex_cmds.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
ex_docmd.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
ex_getln.obj:错误LNK2001:无法解析的外部符号__stdio_common_vfprintf
window.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
gui.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
gui_w32.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
version.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
spell.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
syntax.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
tag.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
term.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
regexp.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
screen.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
search.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
sha256.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
ops.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
option.obj:错误LNK2001:无法解析的外部符号__stdio_common_vsprintf
...
在功能上_onexit _crt_atexit引用
LIBCMT.LIB(utility.obj):错误LNK2019:在功能at_quick_exit引用解析的外部符号_crt_at_quick_exit
LIBCMT.LIB(utility.obj):错误LNK2019:在功能__scrt_dllmain_uninitialize_c引用解析的外部符号_cexit
LIBCMT.LIB(exe_winmain.obj):错误LNK2001:无法解析的外部符号_cexit
LIBCMT.LIB(new_scalar.obj):错误LNK2019:在函数引用解析外部符号_callnewh无效* __cdecl的operator new(无符号__int64)(?? 2 @ YAPEAX_K @ Z)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:?解析的外部符号_seh_filter_exe函数诠释`INT __cdecl __scrt_common_main_seh(无效)'::'1':: FILT $ 0(引用FILT $ 0 @ 0 ?? __ scrt_common_main_seh @ @ YAHXZ @ 4HA)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:在功能诠释__cdecl pre_c_initialization(无效)引用解析的外部符号_set_app_type(?pre_c_initialization @@ YAHXZ)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:解析外部符号__setusermatherr在函数引用诠释__cdecl pre_c_initialization(无效)(pre_c_initialization @@ YAHXZ?)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:解析外部符号_configure_narrow_argv在函数引用诠释__cdecl pre_c_initialization(无效)(pre_c_initialization @@ YAHXZ?)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:在函数引用解析外部符号_get_narrow_winmain_command_lineINT __cdecl __scrt_common_main_seh(无效)(__ scrt_common_main_seh @@ YAHXZ?)
LIBCMT.LIB(exe_winmain.obj):错误LNK2019:在函数引用解析外部符号_inittermINT __cdecl __scrt_common_main_seh(无效)(__ scrt_common_main_seh @@ YAHXZ?)
...
libXpm.lib(rgb.obj):错误LNK2019:在功能xpmGetRGBfromName引用解析的外部符号的strdup
oldnames.lib(strdup.obj):错误LNK2001:无法解析的外部符号的strdup
oldnames.lib(strdup.obj):错误LNK2001:无法解析的外部符号_strdup
的gvim.exe:致命错误LNK1120:183无法解析的外部
我觉得我失去了一些东西明显。 VS 2013和VS 2015年之间是什么改变了?
原来,这已经报道的 vim_dev邮件列表,其原因是由于C运行时的重新组织。
具体来说,链接器的 / NODEFAULTLIB
选项似乎会导致问题。
列入保罗·摩尔的后续为我工作的补丁
包括在Vim中的pre-编译XPM库似乎静态链接到MSVCRT。这个问题在 CRT库特征提到
如果您有多个DLL或EXE,那么你可能++有一个以上的CRT,无论您使用的是不同版本的Visual c。例如,静态链接在CRT成多个DLL可以present同样的问题。开发者遇到了这个问题,静态的CRT显示器已指示与
/ MD
编译使用CRT DLL。现在,CRT DLL已被重命名为msvcr110.dll
,应用程序可能链接到MSVCRT.DLL
部分组件和别人msvcr110.dll
。如果您的dll整个MSVCRT.DLL
和msvcr110.dll
边界传递CRT资源,你会遇到不匹配的CRT问题并且需要重新编译使用Visual C ++项目。
块引用>我没有试图重新编译包含XPM库VS2015,所以XPM的支持是我的gVim的停用现在。
Yesterday, I installed Visual Studio 2015 RC Community Edition. As a first test, I tried building GVim from source.
I opened a command window using
"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2015\Visual Studio Tools\Windows Desktop Command Prompts\VS2015 x64 Native Tools Command Prompt.lnk"
, setset include=%include%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
so
Make_mvc.mak
picks up theWin32.mak
file. Also, I set:set MSVCVER=12.0
as the make file does not detect the new Visual Studio version at this point.
After this, I have:
Framework40Version=v4.0 FrameworkDir=C:\Windows\Microsoft.NET\Framework64 FrameworkDIR64=C:\Windows\Microsoft.NET\Framework64 FrameworkVersion=v4.0.30319 FrameworkVersion64=v4.0.30319 FSHARPINSTALLDIR=C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\ INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE;C:\Program Files (x86)\Windows Kits\10\\include\10.0.10056.0\ucrt;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include LIB=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.10056.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64; LIBPATH=C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral;\Microsoft.VCLibs\14.0\References\CommonConfiguration\neutral; MSVCVER=12.0 Platform=X64 PROCESSOR_ARCHITECTURE=AMD64 UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\ VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ VisualStudioVersion=14.0 VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ VS110COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\ VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\ windir=C:\Windows WindowsSdkDir=C:\Program Files (x86)\Windows Kits\8.1\ WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\ WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\I am able to build a simple program:
C:\...\Temp> type t.c #include int main(void) { printf("Hello %s\n", "Stackoverflow.com"); return 0; } C:\...\Temp> cl t.c Microsoft (R) C/C++ Optimizing Compiler Version 19.00.22816 for x64 Copyright (C) Microsoft Corporation. All rights reserved. t.c Microsoft (R) Incremental Linker Version 14.00.22816.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:t.exe t.obj C:\...\Temp> t.exe Hello Stackoverflow.comHowever, when I issue the command to build my GVim (something which works fine with Visual Studio 2013 CE tools), the compilation goes fine, but I get the following link errors:
C:\...\vim\src> nmake -f Make_mvc.mak CPU=AMD64 OPTIMIZE=SPACE GETTEXT=no NETBEANS=no CSCOPE=no DIRECTX=yes GUI=yesI am snipping most of the error messages because there are a lot of them:
gui_dwrite.obj : error LNK2001: unresolved external symbol memcmp blowfish.obj : error LNK2001: unresolved external symbol memcmp crypt.obj : error LNK2001: unresolved external symbol memcmp sha256.obj : error LNK2001: unresolved external symbol memcmp undo.obj : error LNK2001: unresolved external symbol memcmp blowfish.obj : error LNK2019: unresolved external symbol memcpy referenced in function bf_e_cblock winclip.obj : error LNK2001: unresolved external symbol memcpy screen.obj : error LNK2001: unresolved external symbol memcpy sha256.obj : error LNK2001: unresolved external symbol memcpy gui.obj : error LNK2001: unresolved external symbol memmove gui_w32.obj : error LNK2001: unresolved external symbol memmove tag.obj : error LNK2001: unresolved external symbol memmove term.obj : error LNK2001: unresolved external symbol memmove ui.obj : error LNK2001: unresolved external symbol memmove undo.obj : error LNK2001: unresolved external symbol memmove screen.obj : error LNK2001: unresolved external symbol memmove search.obj : error LNK2001: unresolved external symbol memmove spell.obj : error LNK2001: unresolved external symbol memmove syntax.obj : error LNK2001: unresolved external symbol memmove os_mswin.obj : error LNK2001: unresolved external symbol memmove os_win32.obj : error LNK2001: unresolved external symbol memmove quickfix.obj : error LNK2001: unresolved external symbol memmove regexp.obj : error LNK2001: unresolved external symbol memmove misc2.obj : error LNK2001: unresolved external symbol memmove normal.obj : error LNK2001: unresolved external symbol memmove ops.obj : error LNK2001: unresolved external symbol memmove option.obj : error LNK2001: unresolved external symbol memmove memline.obj : error LNK2001: unresolved external symbol memmove menu.obj : error LNK2001: unresolved external symbol memmove message.obj : error LNK2001: unresolved external symbol memmove misc1.obj : error LNK2001: unresolved external symbol memmove getchar.obj : error LNK2001: unresolved external symbol memmove hashtab.obj : error LNK2001: unresolved external symbol memmove mark.obj : error LNK2001: unresolved external symbol memmove ... misc2.obj : error LNK2001: unresolved external symbol fwrite spell.obj : error LNK2001: unresolved external symbol fwrite edit.obj : error LNK2019: unresolved external symbol isalnum referenced in function ins_ctrl_ey regexp.obj : error LNK2001: unresolved external symbol isalnum ui.obj : error LNK2001: unresolved external symbol strncpy gui_w32.obj : error LNK2001: unresolved external symbol strncpy libXpm.lib(parse.obj) : error LNK2001: unresolved external symbol strncpy libXpm.lib(data.obj) : error LNK2001: unresolved external symbol strncpy regexp.obj : error LNK2001: unresolved external symbol strncpy screen.obj : error LNK2001: unresolved external symbol strncpy ... main.obj : error LNK2001: unresolved external symbol close memfile.obj : error LNK2001: unresolved external symbol close libXpm.lib(parse.obj) : error LNK2001: unresolved external symbol free libXpm.lib(hashtab.obj) : error LNK2001: unresolved external symbol free libXpm.lib(data.obj) : error LNK2001: unresolved external symbol free libXpm.lib(misc.obj) : error LNK2001: unresolved external symbol free ... eval.obj : error LNK2001: unresolved external symbol free misc2.obj : error LNK2001: unresolved external symbol free os_win32.obj : error LNK2001: unresolved external symbol free gui_w32.obj : error LNK2001: unresolved external symbol free libcmt.lib(new_scalar.obj) : error LNK2001: unresolved external symbol malloc libXpm.lib(simx.obj) : error LNK2001: unresolved external symbol malloc eval.obj : error LNK2001: unresolved external symbol malloc misc2.obj : error LNK2001: unresolved external symbol malloc os_win32.obj : error LNK2001: unresolved external symbol malloc gui_w32.obj : error LNK2001: unresolved external symbol malloc normal.obj : error LNK2001: unresolved external symbol realloc regexp.obj : error LNK2001: unresolved external symbol realloc libXpm.lib(simx.obj) : error LNK2001: unresolved external symbol realloc eval.obj : error LNK2001: unresolved external symbol realloc memline.obj : error LNK2001: unresolved external symbol realloc misc1.obj : error LNK2001: unresolved external symbol realloc misc2.obj : error LNK2001: unresolved external symbol realloc ... ex_docmd.obj : error LNK2001: unresolved external symbol stricmp ops.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf option.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf search.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf spell.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf fold.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf getchar.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf main.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf mark.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf eval.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf ex_cmds.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf ex_docmd.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf ex_getln.obj : error LNK2001: unresolved external symbol __stdio_common_vfprintf window.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf gui.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf gui_w32.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf version.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf spell.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf syntax.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf tag.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf term.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf regexp.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf screen.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf search.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf sha256.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf ops.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf option.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf ... _crt_atexit referenced in function _onexit libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol _crt_at_quick_exit referenced in function at_quick_exit libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol _cexit referenced in function __scrt_dllmain_uninitialize_c libcmt.lib(exe_winmain.obj) : error LNK2001: unresolved external symbol _cexit libcmt.lib(new_scalar.obj) : error LNK2019: unresolved external symbol _callnewh referenced in function "void * __cdecl operator new(unsigned __int64)" (??2@YAPEAX_K@Z) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _seh_filter_exe referenced in function "int `int __cdecl __scrt_common_main_seh(void)'::`1'::filt$0" (?filt$0@?0??__scrt_common_main_seh@@YAHXZ@4HA) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _set_app_type referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization@@YAHXZ) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol __setusermatherr referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization@@YAHXZ) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _configure_narrow_argv referenced in function "int __cdecl pre_c_initialization(void)" (?pre_c_initialization@@YAHXZ) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _get_narrow_winmain_command_line referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ) libcmt.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _initterm referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ) ... libXpm.lib(rgb.obj) : error LNK2019: unresolved external symbol strdup referenced in function xpmGetRGBfromName oldnames.lib(strdup.obj) : error LNK2001: unresolved external symbol strdup oldnames.lib(strdup.obj) : error LNK2001: unresolved external symbol _strdup gvim.exe : fatal error LNK1120: 183 unresolved externalsI feel like I am missing something obvious. What changed between VS 2013 and VS 2015?
解决方案It turns out this had already been reported on vim_dev mailing list, and is due to the re-organization of the C runtime.
Specifically, the
/nodefaultlib
option for the linker seems to cause the problem.The patch included in Paul Moore's follow-up worked for me.
The pre-compiled XPM library included with Vim seems to statically link to MSVCRT. This issue is mentioned in CRT Library Features:
If you have more than one DLL or EXE, then you may have more than one CRT, whether or not you are using different versions of Visual C++. For example, statically linking the CRT into multiple DLLs can present the same problem. Developers encountering this problem with static CRTs have been instructed to compile with
/MD
to use the CRT DLL. Now that the CRT DLL has been renamed tomsvcr110.dll
, applications may have some components linked tomsvcrt.dll
and others tomsvcr110.dll
. If your DLLs pass CRT resources across themsvcrt.dll
andmsvcr110.dll
boundary, you will encounter issues with mismatched CRTs and need to recompile your project with Visual C++.I haven't tried to re-compile the included XPM library with VS2015, so XPM support is disabled in my GVim for now.
这篇关于为什么我不能与Visual Studio 2015年RC命令行工具来构建Vim的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!