1

I'm compiling a huge open-source solution (Virtualbox 6.0.4 OSE Windows version actually), and got stuck with the following linking error (provided both command and error, formatted for readability)

C:/MSVS/10.0/VC/bin/link.exe’
-nologo’
-machine:x86
-Ignore:4197
-Driver
-Subsystem:NATIVE
-Incremental:NO
-Align:4096
-MapInfo:Exports
-NoD
-Release
-Debug
-Opt:Ref
-Opt:Icf
-Version:600.4
-Stub:winstub.com'
-IntegrityCheck
/Entry:DriverEntry@8
/OUT:VBoxWddm.sys
/MAPINFO:EXPORTS
/INCREMENTAL:NO
/MAP:VBoxWddm.map
/LIBPATH:C:/WinDDK/7600.16385.1/lib/wlh/i386
/LIBPATH:C:/WinDDK/8.1.1/Lib/win8/km/x86
@VBoxWddm.rsp
Creating library VBoxWddm.lib and object VBoxWddm.exp 
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_fids_table
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_fids_count
BufferOverflowK.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __guard_flags 
VBoxWddm.sys : fatal error LNK1120: 3 unresolved externals

Compiler is VC++ 10.0 (such an outdated compiler required by Oracle for COM interfaces backward compatibility), Windows 7 and 8.1 SDKs are installed.

As I found, __guard_fids_table is a part of Microsoft anti-malware Control Flow Guard API, introduced in Windows 8.1. Some sources tell it requires Visual C++ version 14.0 (which is MSVS 2015 Update 3), however, it's still lack of good documentation of this API, so I'm not 100% sure.

Problem is it could be both bug of the build system (Virtualbox OSE 6 is quite new, and not properly tested), or just some additional configuration required. I need some direction for further investigation, because there's literally no official documentation how to build Oracle Virtualbox 6, and their forum died many years ago.

The main question for that moment, is that even possible to link these objects with VC++ 10.0 or newer compiler required, or maybe just Windows 10 SDK.

Also just great is anyone has experience with compiling Virtualbox 6 already

  • You must be trying to link in a library that was compiled on a newer version of the compiler that *does* support `__guard_fids_table`. There is otherwise no way for a feature that MSVC 10 does not support to end up in the object file. Make sure that you are doing a *complete* build of all modules. In particular, per the error message, rebuild `BufferOverflowK.lib(loadcfg.obj)`. – Cody Gray - on strike Mar 08 '19 at 04:42
  • BufferOverflowK sounds like a .LIB from the WDK and not something you can recompile. – Anders Mar 08 '19 at 07:49
  • Is there any chance that you are mixing lib files from DDK 7 and DDK 8? Maybe try to locate all files in Lib directories of both ddks that contain listed symbol names. – Daniel Sęk Mar 08 '19 at 08:20
  • `__guard_fids_table` and etc - this is absolute symbols. the `link.exe` must understand it. you use old link.exe. your solution - get new build tools from new visual studio or standalone tools and overwrite your `MSVS/10.0/VC/bin` directory – RbMm Mar 08 '19 at 08:45
  • Exactly, BufferOverflowK.lib is a part of DDK, and could not be recompiled. VC++ 10.0 is an explicit requirement of a build system. It has been built someway in commercial version of Virtualbox with the old compiler. May be the problem with passing both path to WDK 7 and 8.1, which looks like some bug in Makefile –  Mar 08 '19 at 14:57
  • you need, if use old linker, use `BufferOverflowK.lib` from *7600.16385.1*, may be exist sense explicit add it as *C:/WinDDK/7600.16385.1/lib/wlh/i386/BufferOverflowK.lib* to link.exe command line – RbMm Mar 08 '19 at 22:55
  • I don't think it's a duplicate - every single question on SO then could be considered as a duplicate of a question "how to write a code?". It describes pretty specific linking problem and a solution –  Mar 25 '19 at 05:56
  • Certainly not related with the presumably "duplicated" link. Moderation failed here... This is a very specific case related to WinDDK. – mgruber4 May 14 '22 at 10:00

1 Answers1

2

If anyone would be interested, I found a solution. Windows DDK 8.0 is the last version supported by VC++ 10.0, and it should be used instead of 7.1 or 8.1. DDK 7.1 declared as not sufficient for building this particular driver, and 8.1 already contains Control Flow Guard API, so 8.0 is the only option left