对于编译为 LLVM IR 的语言 ( Runa ),我正在尝试启用对 Windows 的编译。我想启用与 MSVC 编译的东西的链接,所以我想使用一个 MSVC 目标三元组。我安装了 MSVC Community 2013 并有一个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 东西。