Wireshark-dev: [Wireshark-dev] Problems building easy_codec.dll

From: Gisle Vanem <gvanem@xxxxxxxxxxxx>
Date: Fri, 15 Mar 2013 12:35:35 +0100
I'm having a problem compiling the *non* generated easy_codec_plugin.c. The message from MSVC is: "error C2491: 'version' : definition of dllimport data not allowed"
for the line:
 WS_DLL_PUBLIC_NOEXTERN const gchar version[] = "0.0.1";

The preprocessed output becomes:
 __declspec(dllimport) const gchar version[] = "0.0.1";

So no wonder MSVC is complaining. Looking at the various Makefile.common under plugins, I see only a:

 NONGENERATED_C_FILES = \
         easy_codec_plugin.c     \

in plugins\easy_codec\Makefile.common. Has this fallen behind?

Anyway, this patch fixes it for me:

--- SVN-Latest\plugins\easy_codec\easy_codec_plugin.c   Mon Mar 04 17:52:26 2013
+++ plugins\easy_codec\easy_codec_plugin.c      Fri Mar 15 11:35:08 2013
@@ -25,6 +25,9 @@

#ifndef ENABLE_STATIC
#include "config.h"
+
+/* plugins are DLLs */
+#define WS_BUILD_DLL

#include <gmodule.h>
#include <epan/codecs.h>

--------

The same 'WS_BUILD_DLL' is put in e.g. the *generated* plugins\wimaxasncp\wimaxasncp_plugin.c.

--gv