This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How do I fix “_version already defined in packet-gtpcdr.obj” error?

0

Thanks for you support. Could someone hep me for the following complile error?

link -dll /out:gtpcdr.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /SafeSEH /DYNAMICBASE /FIXED:no  packet-gtpcdr.obj  plugin.obj ..\..\epan\libwireshark.lib  C:\wireshark-win32-libs-1.8\gtk2\lib\glib-2.0.lib  C:\wireshark-win32-libs-1.8\gtk2\lib\gmodule-2.0.lib  C:\wireshark-win32-libs-1.8\gtk2\lib\gobject-2.0.lib gtpcdr.res
plugin.obj : error LNK2005: _version already defined in packet-gtpcdr.obj
   Creating library gtpcdr.lib and object gtpcdr.exp
gtpcdr.dll : fatal error LNK1169: one or more multiply defined symbols found
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x491'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

asked 28 Mar '13, 07:24

steve21's gravatar image

steve21
11557
accept rate: 0%

converted to question 28 Mar '13, 11:29

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196


One Answer:

1

If the variable named version in packet-gtpcdr.c is a plugin version number, get rid of it - that's already taken care of in plugin.c.

If the variable named version in packet-gtpcdr.c is not a plugin version number, but is a variable used in the process of dissecting packets, either rename it or make it a local variable rather than a global variable (global variables are discouraged in dissectors).

answered 28 Mar '13, 11:32

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

Below is the code for variable named version. What do you suggest to modify?

#ifndef ENABLE_STATIC
G_MODULE_EXPORT const guint8 version[] = VERSION;
#endif

#ifndef ENABLE_STATIC G_MODULE_EXPORT void plugin_reg_handoff(void){ proto_reg_handoff_gtpcdr(); } G_MODULE_EXPORT void plugin_register (void) { if (proto_gtpcdr == -1) proto_register_gtpcdr(); } #endif

(28 Mar ‘13, 14:54) steve21

If that code is in packet-gtpcdr.c, I suggest you remove all of it. That code should be in plugin.c, and probably already is in plugin.c.

(28 Mar ‘13, 14:58) Guy Harris ♦♦