Wireshark-dev: Re: [Wireshark-dev] Trouble properly building tshark-based PY extension

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Tue, 29 Jul 2008 17:55:17 -0400

MARK LANDRISCINA wrote:
Works great with one exception. When I load a capture file I get a series of error messages (below) indicating that some of the plug-in modules could not be loaded.

I suspect that there is an error in my build routine, since the C-code works fine (no plug in module errors) when compiled and run as a C executable using wireshark's Makefile/build process. Also, I have to admit, I find wireshark's Makefile to be quite intimidating :)

The "Makefile.am" should be far less intimidating than the "Makefile" (which is machine generated).

I would greatly appreciate it if someone could take a look at the below errors and examine my build commands (also below) to see if there is a way to fix this problem.

The problem is that the plugins are not linked against GLIB nor libwireshark; this assumes that the program trying to load the plugin /is/ linked against those libraries. Rev 24650 explicitly made the plugins not depend on libwireshark and I'm hesitant to reverse that.

You may be be able to solve this in your library by linking it against libwireshark using "-l" instead of listing it as an object on your link line. Otherwise you could patch all of the plugin Makefile.am's like:

Index: plugins/ethercat/Makefile.am
===================================================================
--- plugins/ethercat/Makefile.am        (revision 25859)
+++ plugins/ethercat/Makefile.am        (working copy)
@@ -39,7 +39,7 @@
        $(DISSECTOR_SRC) \
        $(DISSECTOR_INCLUDES)
 ethercat_la_LDFLAGS = -module -avoid-version
-ethercat_la_LIBADD = @PLUGIN_LIBS@
+ethercat_la_LIBADD = @PLUGIN_LIBS@ @GLIB_LIBS@ $(top_builddir)/epan/libwireshark.la
# Libs must be cleared, or else libtool won't create a shared module.
 # If your module needs to be linked against any particular libraries,