简体   繁体   English

错误LNK2001:未解析的外部符号_CLSID_XYS

[英]error LNK2001: unresolved external symbol _CLSID_XYS

There is one idl file defined in microsoft sdk which is not available in VS2005. 在microsoft sdk中定义了一个idl文件,这在VS2005中不可用。 I am using some of the interfaces from that IDL. 我正在使用该IDL的一些接口。

Now this works fine on VS 2010 . 现在这在VS 2010上运行良好。 I want to make it compile on VS2005. 我想让它在VS2005上编译。

I copied the header file to my project directory. 我将头文件复制到我的项目目录中。 But it is giving me compilation error. 但它给了我编译错误。

When I looked into header file , the class id is defined in it as EXTERN_C const CLSID CLSID_Xyz. 当我查看头文件时,类id在其中定义为EXTERN_C const CLSID CLSID_Xyz。

Now it is defined as extern so it means it should be declared somewhere else in code. 现在它被定义为extern,因此它意味着它应该在代码中的其他地方声明。

So my question is just including .h file is sufficient or do I need to also include _i.c file. 所以我的问题是只包括.h文件就足够了或者我还需要包含_i.c文件。

Any suggestions 有什么建议么

Once you examine that _i.c file you'll see the indeed the CLSID constants are defined there. 一旦你检查了_i.c文件,你就会看到确实在那里定义了CLSID常量。 So yes, you need to incorporate that .c file into you program - either by #including it into a .c or .cpp file or just by adding it to your project so that it compiles separately and then links into the final binary. 所以,是的,您需要将.c文件合并到您的程序中 - 通过#include它到.c或.cpp文件中,或者只是将它添加到您的项目中,以便它单独编译然后链接到最终的二进制文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接:错误LNK2001:无法解析的外部符号_WinMainCRTStartup - LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup 错误LNK2001:未解析的外部符号_MessageBox - error LNK2001: unresolved external symbol _MessageBox 我收到错误“LINK:错误LNK2001:未解析的外部符号_WinMainCRTStartup” - I'm getting the error “LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup” 声明了 DllMain 的 .dll 中的 LNK2001 未解析的外部符号 _main? - LNK2001 unresolved external symbol _main in .dll with DllMain declared? Win32应用程序LNK2001:无法解析的外部符号_main - Win32 Application LNK2001: unresolved external symbol _main Win32错误LNK2019:无法解析的外部符号 - Win32 error LNK2019: unresolved external symbol LNK2019:未解析的外部符号 - LNK2019: Unresolved external symbol Cython DLL 扩展编译使用 WINAPI 在链接期间失败并出现错误 LNK2001 - Cython DLL extension compilation using WINAPI fails during linking with error LNK2001 错误 LNK2019:function 中引用的未解析外部符号 _Direct3DCreate9Ex@8“受保护:XYX()” - error LNK2019: unresolved external symbol _Direct3DCreate9Ex@8 referenced in function "protected: XYX()" C ++程序中的TCHAR和未解析的外部符号(LNK2019)错误? - TCHAR and unresolved external symbol (LNK2019) error in C++ program?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM