Wireshark-dev: [Wireshark-dev] linker error trying to build wireshark with basic dissector code
Hi all, I'm trying to build the basic dissector plugin template as found in the developers guide. It compiles fine, however when it tries to link it, i get this linker error:
_____________________________BEGIN ERROR_______________________________
.libs/blksh.la-1.o(.rodata+0x0): In function `plugin_register':
/home/deb32/wireshark-0.99.4/plugins/blksh/plugin.c:19: multiple definition of `version'
.libs/packet-blksh.o(.rodata+0x0):/home/deb32/wireshark-
0.99.4/plugins/blksh/packet-blksh.c:39: first defined here
.libs/blksh.la-1.o(.text+0x0): In function `plugin_register':
/home/deb32/wireshark-0.99.4/plugins/blksh/plugin.c:19: multiple definition of `plugin_register'
.libs/packet-blksh.o(.text+0x0):/home/deb32/wireshark-0.99.4/plugins/blksh/packet-blksh.c:39: first defined here
/usr/bin/ld: Warning: size of symbol `plugin_register' changed from 39 to 27 in .libs/blksh.la-1.o
.libs/blksh.la-1.o(.text+0x1c): In function `plugin_reg_handoff':
/home/deb32/wireshark-0.99.4/plugins/blksh/plugin.c:25: multiple definition of `plugin_reg_handoff'
.libs/packet-blksh.o(.text+0x28):/home/deb32/wireshark-
0.99.4/plugins/blksh/packet-blksh.c:47: first defined here
make[3]: *** [blksh.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
__________________________END ERROR_____________________________________
My plugin_register function is defined as such...
___________________________CODE BEGIN____________________________________
#ifndef ENABLE_STATIC
G_MODULE_EXPORT void
plugin_register(void)
{
/* register the new protocol, protocol fields and subtrees */
if (proto_blk_sim_hello == -1) { /* protocol init, done only once */
proto_register_blk_sim_hello();
}
}
G_MODULE_EXPORT void
plugin_reg_handoff(void) {
proto_reg_handoff_blk_sim_hello();
}
#endif
___________________________CODE END____________________________
Any insight into this would be appreciated. Thanks a lot.
--
Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look into an abyss, the abyss also looks
into you.
-- Friedrich Nietzsche