当前位置: 代码迷 >> 综合 >> uefi 编译错误解决方案
  详细解决方案

uefi 编译错误解决方案

热度:40   发布时间:2023-12-14 22:24:58.0

没有include 是 undefined
unresolved 是 没有link , 对应的define 没有真正的实现

举例:

/Id:\project\edk2\CryptoPkg\Include  /Id:\project\edk2\CryptoPkg\Library\Include  /Id:\project\edk2\CryptoPkg\Library\OpensslLib\openssl\include  /Id:\project\edk2\CryptoPkg\Library\OpensslLib\openssl\crypto\i
meDxe\DEBUG\AutoGen.c
AutoGen.c
        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\lib.exe" /NOLOGO /LTCG /OUT:d:\project\Build\CryptoPkg\NOOPT_VS2015x86\IA32\CryptoPkg\CryptRuntimeDxe\CryptRuntimeDxe\OUTPUT\CryptRuntimeDxe.
Dxe\OUTPUT\object_files.lst
        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\link.exe" /OUT:d:\project\Build\CryptoPkg\NOOPT_VS2015x86\IA32\CryptoPkg\CryptRuntimeDxe\CryptRuntimeDxe\DEBUG\CryptRuntimeDxe.dll /NOLOGO /N
ata,D /MACHINE:X86 /LTCG /DLL /ENTRY:_ModuleEntryPoint /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG   @d:\project\Build\CryptoPkg\NOOPT_VS2015x86\IA32\CryptoPkg\CryptRuntimeDxe\CryptRu
OpensslLib.lib(rand.obj) : error LNK2001: unresolved external symbol _GetRandomNumber128
d:\project\Build\CryptoPkg\NOOPT_VS2015x86\IA32\CryptoPkg\CryptRuntimeDxe\CryptRuntimeDxe\DEBUG\CryptRuntimeDxe.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\link.exe"' : return code '0x460'
Stop.

方法就是在inf 里面写入要用到的lib。

[LibraryClasses]
  DebugLib
  IntrinsicLib
  RngLib
其次就是在dsc 里面加入具体的实例。

RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf

  相关解决方案