Wireshark-dev: Re: [Wireshark-dev] linking errors on Windows

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 24 Feb 2016 12:11:43 -0800
On Feb 23, 2016, at 9:25 PM, Edwin Groothuis <edwin.groothuis@xxxxxxxxxxxx> wrote:
 
> I’m in the process of upgrading an 1.10 environment into the 2.0 century

Skipping 1.12 entirely....

> and run in one last problem: The functions from a new file in epan/ don’t get recognized by the linker for VS2013. I have added it to Makefile.common,

As Graham asked, are you building with CMake?  If so, you need to add it to LIBWIRESHARK_FILES in epan\CMakeLists.txt.

> the include file contains the WS_DLL_PUBLIC declaration. In the past I needed to add the symbol to libwireshark.def, but that file seems to have disappeared in 2.0.

libwireshark.def isn't present in 1.10, either; 1.10 was, in fact, the release in which it disappeared. "The past" must've been with 1.8 or earlier.

> Who has a push in the right direction for me to get these functions properly exported in a 2.0 environment so the VS2013 linker can resolve them?

Same way as you'd do it in a 1.10 environment or a 1.12 environment - declare it in a header file with WS_DLL_PUBLIC and *make sure that the file in which it's defined includes that header file* (which is *always* what should be done in C-based languages in all versions of all programs, to make sure the definition agrees with the declaration).

In a 2.x environment, you also have to make sure the file is in the appropriate CMakeLists.txt as well as the appropriate Makefile.common.