精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源心得,转载请注明出处:锐英源,www.wisestudy.cn,孙老师作品,联系电话13803810136。
Thank Guy Harris,Your Advice is very good,there is no error in link for g_thread_init.
the Key is:
>libwireshark_LIBS = \
> $(GTHREAD_LIBS) \
In the beginning,I changed wrong place in makefile,I know I have to add libs,but I use the way for gcc,and I choosed wrong place,Since i don't understand the relation between epan and dissector.
在 2011-08-24 15:54:10,"Guy Harris" <guy@alum.mit.edu> 写道:
>
>On Aug 24, 2011, at 12:11 AM, lookfar wrote:
>
>> 正在创建库 libwireshark.lib 和对象 libwireshark.exp
>> dissectors.lib(packet-ppp.obj) : error LNK2019: 无法解析的外部符号 _g_thread_ini
>> t,该符号在函数 _proto_register_ppp 中被引用
>> libwireshark.dll : fatal error LNK1120: 1 个无法解析的外部命令
>> NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 9.0\VC\BI
>> N\link.EXE"”: 返回代码“0x460”
>> Stop.
>> NMAKE : fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 9.0\VC\BI
>> N\nmake.exe"”: 返回代码“0x2”
>
>For those of us who don't read Chinese, Google Translate says that's
>
> Creating library libwireshark.lib and objects libwireshark.exp
> dissectors.lib (packet-ppp.obj): error LNK2019: unresolved external symbol _g_thread_init, the symbol is referenced in function _proto_register_ppp
> libwireshark.dll: fatal error LNK1120: 1 unresolved externals
> NMAKE: fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"”: return code "0x460"
> Stop.
> NMAKE: fatal error U1077: “"D:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"”: return code "0x2"
> Stop.
>
>(why "fatal error" is in English and "return code" isn't, well...).
>
>> My version is wireshark-1.7.0-SVN-38520,I have changed the dissector nmake file to add line like:
>>
>> CFLAGS= $(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
>> /I. /I.. /I../.. $(GLIB_CFLAGS) \
>> $(GTHREAD_LIBS) \
>> # `pkg-config --cflags --libs glib-2.0 gthread-2.0` \
>> $(ZLIB_CFLAGS) \
>> $(PCRE_CFLAGS) $(GNUTLS_CFLAGS) $(NETTLE_CFLAGS) \
>> $(KFW_CFLAGS) $(AIRPCAP_CFLAGS) $(GEOIP_CFLAGS) \
>> /I$(PCAP_DIR)\include
>
>What happens if you *don't* make that change, but, instead, change epan\Makefile.nmake to do something such as
>
>libwireshark_LIBS = \
> $(GTHREAD_LIBS) \
> $(GLIB_LIBS) \
> $(C_ARES_LIBS) \
> $(ADNS_LIBS) \
> $(KFW_LIBS) \
> $(NETTLE_LIBS) \
> $(ZLIB_LIBS) \
> $(GNUTLS_LIBS) \
> $(LUA_LIBS) \
> $(PYTHON_LIBS) \
> $(SMI_LIBS) \
> $(GEOIP_LIBS) \
> ..\wsutil\libwsutil.lib \
> ..\wiretap\wiretap-$(WTAP_VERSION).lib \
> crc\crc.lib \
> crypt\airpdcap.lib \
> ftypes\ftypes.lib \
> dfilter\dfilter.lib \
> $(WSLUA_LIB) \
> $(WSPYTHON_LIB) \
> dissectors\dissectors.lib
>
>so that libwireshark is linked with $(GTHREAD_LIBS)
>
>___________________________________________________________________________
>Sent via: Wireshark-dev mailing list <wireshark-dev@wireshark.org>
>Archives: http://www.wireshark.org/lists/wireshark-dev
>Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
> mailto:wireshark-dev-request@wireshark.org subject=unsubscribe