Wireshark-dev: Re: [Wireshark-dev] Do Windows compilers require WS_VAR_IMPORT in .h files
From: Pascal Quantin <pascal.quantin@xxxxxxxxx>
Date: Fri, 28 Sep 2012 17:25:41 +0200
2012/9/28 Joerg Mayer <jmayer@xxxxxxxxx>
Hello,

I'm working on building wireshark with gcc with -fvisibility=hidden. This
will mostly mimic the behaviour already on Windows. The gcc attribute
to change the visibility causes errors when used in .h files (well, in
declarations without a  the object).
I have replaced WS_VAR_IMPORT with extern in .h files. Can someone on Windows
please test whether this still works?

Hi Jörg,

it fails with the following errors (MSVC2010EE 32 bits):

        link -dll /out:profinet.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x86 /SafeSEH /DYNAMICBASE /FIXED:no  packet-dcerpc-pn-io.obj  packet-dcom-cba.obj  packet-dcom-cba-acco.obj  packet-pn-dcp.obj  packet-pn-mrp.obj  packet-pn-mrrt.obj  packet-pn-ptcp.obj  packet-pn-rt.obj packet-pn.obj plugin.obj ..\..\epan\libwireshark.lib  D:\dev\wireshark-win32-libs\gtk2\lib\glib-2.0.lib  D:\dev\wireshark-win32-libs\gtk2\lib\gmodule-2.0.lib  D:\dev\wireshark-win32-libs\gtk2\lib\gobject-2.0.lib profinet.res
   Creating library profinet.lib and object profinet.exp
packet-dcom-cba.obj : error LNK2001: unresolved external symbol _dcom_hresult_vals
packet-dcom-cba-acco.obj : error LNK2019: unresolved external symbol _dcom_hresult_vals referenced in function _dissect_CBA_Connection_Data
packet-dcom-cba-acco.obj : error LNK2001: unresolved external symbol _dcom_variant_type_vals
profinet.dll : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

Regards,
Pascal.