windowscomvisual-c++-2013vds

unresolved external symbol _CLSID_VdsLoader


I'm trying to write a program that can manage the harddisks/volumes/partitions in a Windows system. It seemed like a good idea to use Windows' Virtual Disk Service to accomplish this.

I wrote a bit of code to try it out, but when linking it I get the following error: error LNK2001: unresolved external symbol _CLSID_VdsLoader

Microsofts sample code indicates that I have to link to ole32.lib, and from googling I learned that uuid.lib is also involved. The "Additional Dependencies" line in my project settings is the following:

kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)

As you can see, both previously mentioned libraries are included.

I'm trying all this on Visual C++ Express for Windows Desktop 2013. Could this be the problem? Perhaps the express version does not support 100% of the available COM objects? If that's not it, what else could it be?


Solution

  • This is explained here: How to avoid error "LNK2001 unresolved external" by using DEFINE_GUID, you just need for example to add #include <InitGuid.h> in your stdafx.h file.