ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] Can't compile Ethereal from current CVS on Windows.

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Gisle Vanem" <giva@xxxxxxxxx>
Date: Mon, 25 Aug 2003 19:24:22 +0200
"Greg Morris" <GMORRIS@xxxxxxxxxx> said:

> To successfully compile I had to add the following lines to both the
> /epan/plugins.c and /plugins/plugin_api.h files.
>  
> #include "packet-per.h"
> #include "packet-h225.h"
> #include "packet-h245.h"

I had the same problem (using MingW).
The root of the problem I think is the way plugins imports symbols
from the parent exe (via the func-pointer in generated plugins/X* files). 
This comment in plugins/plugin_api.h made me stall:

#ifdef PLUGINS_NEED_ADDRESS_TABLE

/* Some OSes (Win32) have DLLs that cannot reference symbols in the parent
   executable, so the executable needs to provide a collection of pointers
   to global variables and functions for the DLL plugin to use. */

When was this true? An .exe-file can export symbols just as easily as an
DLL can. But it AFAIK requires all exported and imported symbols be marked 
correctly. Something like:

#if defined(WIN32)
  #if defined(BUILDING_PLUGIN)
    #define ETR_API __declspec (dllimport)
  #else
    #define ETR_API __declspec (dllexport)
  #endif
#else
  #define ETR_API 
#endif

I wish we could do away with the plugins/X* hack and use a (generated)
.def-file and the above decoration instead. But it's a huge job to go through
all files and prepend ETR_API to all prototypes.

--gv