Clrdump(C ++)错误LNK2019:函数_main中引用的未解析的外部符号__imp__RegisterFilter @ 8 [英] Clrdump (C++) error LNK2019: unresolved external symbol __imp__RegisterFilter@8 referenced in function _main

查看:167
本文介绍了Clrdump(C ++)错误LNK2019:函数_main中引用的未解析的外部符号__imp__RegisterFilter @ 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有pvcs编译器的makefile系统(使用Microsoft Visual C ++,2008编译器),并且遇到以下几种形式的链接错误:

I am using a makefile system with the pvcs compiler (using Microsoft Visual C++, 2008 compiler) and I am getting several link errors of the form:

error LNK2019: unresolved external symbol __imp__RegisterFilter@8 referenced in function _main

这是使用extern "C"声明进行的,即:

This is happening DESPITE using the extern "C" declaration, viz.:

extern "C" int CLRDUMP_API RegisterFilter( LPCWSTR pDumpFileName, unsigned long DumpType );

此外,在makeexe.mak中,该库的链接方式为:

Also, in the makeexe.mak, the library is being linked in as:

$(COMPILEBASE)\ lib \ clrdump.lib \

$(COMPILEBASE)\lib\clrdump.lib \

说实话,我不是makefile的专家,我正在将系统从Microsoft Visual C ++ 6.0切换到2008.由于系统过去可以正常工作,所以此切换可能与链接错误有关之前.

To be honest, I am not an expert at makefiles, and I am changing over a system from Microsoft Visual C++ 6.0 to 2008. This change-over may have something to do with the link errors, as the system used to work before.

我们将不胜感激.

预先感谢

此致, 约瑟夫

-编辑1-

有人知道如何在pvc的makefile系统中打开详细信息吗?

Does anyone know how to turn verbose on in the makefile system of pvcs?

请注意,上述函数已经是编译器装饰的版本,具有

Note that the above function is already a compiler-decorated version, having

__imp__RegisterFilter@8

而C ++函数只是

RegisterFilter

感谢您的帮助,但是如果任何人都可以发布更完整的解决方案,那也将不胜感激.

Thanks for the help, but if anyone can post a more complete solution, that would also be very appreciated.

真诚的约瑟夫

-编辑2-

某人张贴了此消息,但是当我登录时消失了:

Some kind person posted this, but when I signed in it disappeared:

imp前缀表示此函数是从DLL导入的.检查CLRDUMP_API的定义-是__declspec(dllimport)吗?有关更多信息,请参见本文.

The imp prefix indicates that this function is imported from a DLL. Check the definition of CLRDUMP_API - is it __declspec(dllimport)? See this article for more information.

有一个有效的链接,但我已经丢失了,但是我想总是可以搜索该主题.

There was a working link, but I've lost that, however I suppose one can always search the topic.

谢谢,无论您是谁!

-编辑3-

感谢ChrisN(我尚未投票).尽管使用了刷新按钮,您的答案还是消失了,但是在我发布剪切粘贴后又重新出现了.

Thanks ChrisN (I'm not yet allowed to vote). Despite using the refresh button, your answer disappeared, but then re-appeared after I posted a cut-n-paste.

这是我的定义:

define CLRDUMP_API __declspec(dllimport) __stdcall

我认为__stdcall可以吗?

I assume that the __stdcall is OK?

-编辑4-

尽管我赞赏那些回答者,尤其是ChrisN,至少在我的特定系统上所做的努力,但仍然存在链接错误.因此,如果有人有任何进一步的见解,我将不胜感激.再次感谢.

While I appreciate the efforts of those who answered, particularly ChrisN, at least on my particular system, the link error remains. So if anyone has any further insight, I'd appreciate it. Thanks again.

推荐答案

我正在VS2005中创建一个简单的Win32 c ++应用程序,但出现此错误:

I was creating a simple Win32 c++ application in VS2005 and I was getting this error:

LNK2019: unresolved external symbol __imp__somefunction

该应用程序正在使用属性表,因此需要此标头(prsht.h).

This application was using property sheets, hence it required this header (prsht.h).

我的问题的解决方案如下:在程序属性→配置属性→链接器→常规中,将其他库目录设置为"C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib".

The solution to my problem was as follows: in program Properties→Configuration Properties→Linker→General, I set Additional Library Directories to "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib".

还在程序属性→配置属性→链接器→命令行中为其他选项添加了ComCtl32.Lib ComDlg32.Lib.

我的程序正在编译,没有任何问题.我的两分钱:您需要确定程序需要的所有库.提示:检查所有包含的标题,您需要确保链接器可以看到它们.

My program is now compiling without any problems. My two cents: you need to identify all the libraries that your program requires. Hint: check all the headers you have included, you need to make sure that your linker can see them.

这篇关于Clrdump(C ++)错误LNK2019:函数_main中引用的未解析的外部符号__imp__RegisterFilter @ 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆