I created a plugin it is working fine in my system as i had visual studio installed in my system.when i took the same .dll file and copied it in other system under win64 wireshark plugin directory it is giving missing msvcr120.dll while executing the wireshark.Is there any way to solve this problem.please help me with this? asked 16 Apr '15, 00:10 lakshmi edited 16 Apr '15, 00:42 |
One Answer:
When you compile a plugin (or any other application) with current versions of Visual Studio, it often comes with a dependency on the C runtime library for that version of Visual Studio. In your case, the dependency on msvcr120.dll indicates the plugin was compiled with Visual Studio 2013 (aka 12). In addition to this, if the item is a dll, such as a plugin, then it must use the same C runtime as the application that's loading the dll. If you're using the current release of Wireshark (1.12.x) then that was compiled with VS2010 and uses msvcr100.dll and any plugins should be compiled using the same compiler. The current development release (1.99.x) uses the VS2013 compiler. answered 16 Apr '15, 01:29 grahamb ♦ showing 5 of 7 show 2 more comments |
so, there is no option other than copying msvcr120.dll in the wiresahrk directory in order to execute. i compiled the wireshark using visual studio 2013. Is there any way to remove the dependency and compile my wireshark build?
You can try running the appropriate vcredist_xxx from MS which will install the VS2013 C runtime dll's, but I don't think the plugin will run due to mismatched runtime dll's.
As I explained above, currently the rules require that a dll and the application loading it must use the same C runtime version.
You can produce a complete installer with your current VS2013 build which will work, but your users must install the entire VS2013 built version, not just the plugin.
I have another doubt .I know my doubts are silly but please clarify. I have downloaded 1.12 source code and wrote a plugin and compiled it using visual studio 2013. I tried using my plugin dll in windows 1.12 installer 64 bit .it worked fine even though installer is compiled using visual studio 2010. but when i tried with the windows 1.10.3 64 bit installer and installer is also using visual studio 2010,while executing the wireshark,it is stopping in the middle when it comes to registering plugins. can i know reason for this? Is it like it will execute only in one version.
Thanks grahamb,for your quick reply.please clarify my other doubt.
Yes. Plugins can only be built for a specific major version of Wireshark.
You will need two separate builds of the plugin for 1.10.x and 1.12.x.
Having an application using one version of the C runtime and a dll using another might work, it's really not recommended. See here for a discussion on why it's a bad idea.
A final point to note, plugins must still follow the GPL requirements, in that if you distribute the plugin outside your company you must make the source code available.
thank u for your reply.
Is it the same case if we write the dissector using lua? Do we have to build it for different versions?
The Lua support has changed quite a bit over the versions, but if you only use the Lua API that was available in the lowest version, and implement workarounds where that API has changed in later versions, then possibly.
I think the code will have to be version aware though, and will still be subject to the GPL.