The sample program is written in C++, although the Virtual Disk API also supports C. For compilation to succeed, the correct DLLs or shared objects must be loaded. You can ensure the success of dynamic loading in a variety of ways.
Note that VDDK loads DLLs by relative path rather than absolute path, so conflicting versions of the DLLs could cause problems.