DEFINE_GUID link error 解决

微软官方解释:

http://support.microsoft.com/kb/130869

同时参考:

http://zhanyonhu.blog.163.com/blog/static/161860442008989562511/

总结起来,要保证DEFINE_GUID能够链接通过

在需要调用DEFINE_GUID的文件中

在所有其它头文件的最后面,在DEFINE_GUID调用之前,#include <initguid.h>  。

#include "stdafx.h"

#include "videoManager.h"

#include "Streams.h"

#include <dvdmedia.h>

//must include this after all other include and before guid define

#include <initguid.h>  

// { 36a5f770-fe4c-11ce-a8ed-00aa002feab5 }

DEFINE_GUID(CLSID_Dump, 0x36a5f770, 0xfe4c, 0x11ce, 0xa8, 0xed, 0x00, 0xaa, 0x00, 0x2f, 0xea, 0xb5);

希望能对遇到同样问题的同学有所帮助。

原文地址:https://www.cnblogs.com/oyjj/p/2132920.html