对于我的语言(露娜),它编译为LLVM,我正在尝试将编译启用到Windows。我想启用与MSVC编译的东西的链接,所以我想使用MSVC目标三重。我安装了MSVCCommunity2013,并在其中运行了一个cmd.exe窗口,运行了附带的vcvars32.bat脚本,这样就可以将大量MSVC内容添加到PATH中。但是,在试图编译时,我会得到以下链接器错误:
hello-163edf.obj : error LNK2019: unresolved external symbol malloc referenced in function runa.malloc
hello-163edf.obj : error LNK2019: unresolved external symbol free referenced in function runa.free
hello-163edf.obj : error LNK2019: unresolved external symbol memcpy referenced in function runa.memcpy
hello-163edf.obj : error LNK2019: unresolved external symbol write referenced in function runa.unhandled
hello-163edf.obj : error LNK2019: unresolved external symbol exit referenced in function runa.clean
hello-163edf.obj : error LNK2019: unresolved external symbol _Unwind_RaiseException referenced in function runa.raise
hello-163edf.obj : error LNK2019: unresolved external symbol snprintf referenced in function float.__str__
hello-163edf.obj : error LNK2019: unresolved external symbol strlen referenced in function uint.__str__
hello-163edf.obj : error LNK2019: unresolved external symbol __chkstk referenced in function str.__eq__
hello-163edf.obj : error LNK2019: unresolved external symbol strncmp referenced in function str.__eq__
hello-163edf.obj : error LNK2001: unresolved external symbol _fltused我理解关于_Unwind_RaiseException的内容,这可能不符合这个目标,但我不清楚为什么不能找到malloc()这样的基本的libc东西。
发布于 2015-01-07 20:40:18
大多数问题都是通过将/link msvcrt.lib添加到编译器调用的末尾来解决的。
发布于 2019-06-28 10:42:18
根据您的构建过程和visual版本,您可能需要msvcrt、vcruntime和ucrt。有关更深入的解释,请参阅本文:https://devblogs.microsoft.com/cppblog/introducing-the-universal-crt/。
https://stackoverflow.com/questions/27827857
复制相似问题