Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

undefined symbol error while running wireshark after building plugin

Hi! I've just started developing plugins in c and I've been trying to resolve this issue for weeks but no luck. Please help. I'm not able to link the library in the subfolder of the plugin to the plugin. The programs compiles fine, but when Wireshark is started it produced the error "undefined symbol" for the function name. I've a plugin folder inside which there is a subfolder which contains the library whose function I'm calling in the plugin.

plugins folder  
 | -> . .  
 | -> gryphon  
 |  -> irda  
 |  ->test  (my plugin)  
        | ->temp (subfolder which contains the library)

Content of test/Makefile.am

include $(top_srcdir)/Makefile.am.inc
include ../Makefile.am.inc
PLUGIN_NAME = test
PLUGIN_VERSION = 0.0.1 
BUILT_SOURCES = \
plugin.c

LIBS += -L/usr/local/lib/wireshark/plugins/2.4.5/temp

SUBDIRS=temp
NONGENERATED_REGISTER_C_FILES = \
    test.c

NONGENERATED_C_FILES = \
    $(NONGENERATED_REGISTER_C_FILES)

CLEAN_HEADER_FILES = \
    test.h

HEADER_FILES = \
    $(CLEAN_HEADER_FILES)

plugin_LTLIBRARIES = test.la

test_la_SOURCES = \
    $(SRC_FILES)    \
    $(HEADER_FILES)

nodist_test_la_SOURCES = \
    plugin.c

test_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_CPPFLAGS) -Itemp

test_la_CFLAGS = $(AM_CFLAGS) $(PLUGIN_CFLAGS)

test_la_LDFLAGS = $(PLUGIN_LDFLAGS) temp/libhello.la


DISTCLEANFILES = \
    plugin.c

Content of temp/Makfile.am

include $(top_srcdir)/Makefile.am.inc
include ../../Makefile.am.inc
PLUGIN_NAME = libhello
tempdir=${libdir}/wireshark/plugins/2.4.5/temp
temp_LTLIBRARIES= libhello.la
libhello_la_SOURCES= say.c say.h
libhello_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_CPPFLAGS) 
libhello_la_CFLAGS = $(AM_CFLAGS) $(PLUGIN_CFLAGS)
libhello_la_LDFLAGS = $(PLUGIN_LDFLAGS)