如何用Visual Studio 2005编译Wireshark的插件

今天尝试用Visual Studio 2005编译以前用Visual Studio 2003编译成功过的一个Wireshark插件,生成后发现居然无法在官方的Wireshark中加载插件。在 KenThompson的“Creating Your Own Custom Wireshark Dissector”一文中提到使用Visual Studio 2005编译生成的插件只能在使用Visual Studio 2005生成的Wireshark版本中测试。使用自己采用Visual Studio 2005生成的Wireshark版本测试,发现确实可以,而官方的就不行了。使用Dependency Walker看了看,发现使用Visual Studio 2005生成的DLL文件需要使用MSVCR80.DLL,而官方的Wireshark使用的是MSVCRT.DLL,两者不兼容,所以会出现错误。在微软的网站上可以找到解决的方法

      mt.exe –manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2

将这样处理后的DLL再拷贝到官方的Wireshark的插件目录中就可以了。不过采用Visual Studio 2005生成的插件要分发时必须同时分发Visual Studio 2005的C语言运行库,看来不如Visual Studio 2003方便。

原文地址:https://www.cnblogs.com/zealsoft/p/1443219.html