我正在寻找有关如何使用 Visual Studio 2012 项目使用 EDK2 SDK 构建 UEFI 驱动程序的建议。我正在尝试静态链接 UefiLib.lib 但失败得很惨。我已将 lib 添加到链接器下的附加依赖项中。
#include <Uefi.h>
#include <Library/UefiLib.h>
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
Print((CHAR16 *)L"Welcome to the world of EDK II.\n");
return EFI_SUCCESS;
}
错误是
test.obj : error LNK2001: unresolved external symbol "unsigned __int64 __cdecl Print(unsigned short const *,...)" (?Print@@YA_KPEBGZZ)
现在我已经使用 DUMPBIN 来确保 Print 存在于 lib 中,但是它不是作为导出或导入存在,而是作为存档成员存在。我不确定这是否是问题所在。