This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

LTE RRC dissector linker issue

0

Hi I was trying to create a dll for my own dissector, compilation went through, in dll creation I am facing the issue as below. kindly provide views for the issue. Thanks in advance.

link -dll /out:rrc-fsm.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x64 /DYNAMICBASE /FIXED:no  packet-lte-rrc-fsm.obj  plugin.obj ..\..\libwireshark.lib ..\dissectors.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\glib-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gmodule-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gobject-2.0.lib rrc-fsm.res
dissectors.lib(packet-gsm_a_common.obj) : error LNK2005: de_ms_cm_2 already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-gsm_a_common.obj) : error LNK2005: de_ms_cm_3 already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2005: de_gmm_ms_radio_acc_cap already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_null already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_constrained_sequence_of already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_boolean already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_constrained_integer already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_enumerated already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_choice already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_sequence already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_sequence_eag already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_bit_string already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_octet_string already defined in libwireshark.lib(libwireshark.dll)
dissectors.lib(packet-per.obj) : error LNK2005: dissect_per_octet_string_containing_pdu_new already defined in libwireshark.lib(libwireshark.dll)
   Creating library rrc-fsm.lib and object rrc-fsm.exp
dissectors.lib(packet-gsm_a_common.obj) : error LNK2001: unresolved external symbol tfs_supported_not_supported
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2001: unresolved external symbol tfs_supported_not_supported
dissectors.lib(packet-bssgp.obj) : error LNK2001: unresolved external symbol tfs_supported_not_supported
dissectors.lib(packet-gsm_a_bssmap.obj) : error LNK2001: unresolved external symbol tfs_supported_not_supported
dissectors.lib(packet-nas_eps.obj) : error LNK2019: unresolved external symbol match_strval_idx_ext referenced in function get_nas_esm_msg_params
dissectors.lib(packet-bssgp.obj) : error LNK2001: unresolved external symbol match_strval_idx_ext
dissectors.lib(packet-sgsap.obj) : error LNK2001: unresolved external symbol match_strval_idx_ext
dissectors.lib(packet-gsm_a_bssmap.obj) : error LNK2001: unresolved external symbol match_strval_idx_ext
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2001: unresolved external symbol tfs_present_not_present
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2001: unresolved external symbol tfs_implemented_not_implemented
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2001: unresolved external symbol ipproto_val_ext
dissectors.lib(packet-ip.obj) : error LNK2001: unresolved external symbol ipproto_val_ext
dissectors.lib(packet-gsm_a_dtap.obj) : error LNK2019: unresolved external symbol tvb_get_ephemeral_unicode_string referenced in function de_network_name
dissectors.lib(packet-per.obj) : error LNK2001: unresolved external symbol tvb_get_ephemeral_unicode_string
dissectors.lib(packet-gsm_sms.obj) : error LNK2001: unresolved external symbol tvb_get_ephemeral_unicode_string
dissectors.lib(packet-gsm_a_dtap.obj) : error LNK2019: unresolved external symbol IA5_7BIT_decode referenced in function de_sub_addr
dissectors.lib(packet-gmr1_rr.obj) : error LNK2019: unresolved external symbol proto_tree_add_split_bits_item_ret_val referenced in function gmr1_ie_rr_pkt_imm_ass_3_prm
dissectors.lib(packet-gsm_a_rr.obj) : error LNK2001: unresolved external symbol proto_tree_add_split_bits_item_ret_val
dissectors.lib(packet-bssgp.obj) : error LNK2001: unresolved external symbol tfs_reliable_not_reliable
dissectors.lib(packet-bssgp.obj) : error LNK2001: unresolved external symbol tfs_requested_not_requested
dissectors.lib(packet-gsm_bssmap_le.obj) : error LNK2001: unresolved external symbol tfs_requested_not_requested
This question is marked "community wiki".

asked 01 Dec '15, 11:10

Viswanathan%20Jagadeesan's gravatar image

Viswanathan ...
1112
accept rate: 0%

edited 01 Dec '15, 13:01

grahamb's gravatar image

grahamb ♦
19.8k330206


2 Answers:

0

You should not link with both libwireshark.lib and dissectors.lib. Remove the latter and keep only libwireshark.lib.

answered 01 Dec '15, 12:14

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Thanks many for response, after removing dissector.lib output as

link -dll /out:rrc-fsm.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x64 /DYNAMICBASE /FIXED:no  packet-lte-rrc-fsm.obj  plugin.obj ..\..\libwireshark.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\glib-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gmodule-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gobject-2.0.lib rrc-fsm.res
   Creating library rrc-fsm.lib and object rrc-fsm.exp
packet-lte-rrc-fsm.obj : error LNK2001: unresolved external symbol gsm_a_rr_rxlev_vals_ext
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol de_emm_sec_par_from_eutra referenced in function dissect_lte_rrc_T_nas_SecurityParamFromEUTRA
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol de_emm_sec_par_to_eutra referenced in function dissect_lte_rrc_T_nas_SecurityParamToEUTRA
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_Ellipsoid_Point_PDU referenced in function dissect_lte_rrc_T_ellipsoid_Point_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_EllipsoidPointWithAltitude_PDU referenced in function dissect_lte_rrc_T_ellipsoidPointWithAltitude_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_HorizontalVelocity_PDU referenced in function dissect_lte_rrc_T_horizontalVelocity_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_rrc_InterRATHandoverInfo_PDU referenced in function dissect_lte_rrc_T_ueCapabilityRAT_Container
rrc-fsm.dll : fatal error LNK1120: 7 unresolved externals

after removing libwireshark.lib output as

link -dll /out:rrc-fsm.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x64 /DYNAMICBASE /FIXED:no  packet-lte-rrc-fsm.obj  plugin.obj ..\dissectors.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\glib-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gmodule-2.0.lib  C:\wireshark-win64-libs-1.8\gtk2\lib\gobject-2.0.lib rrc-fsm.res
   Creating library rrc-fsm.lib and object rrc-fsm.exp
dissectors.lib(packet-q708.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-ranap.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-rtp.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-ipx.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-ip.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_sms.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-q931.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-ber.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-s1ap.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-e212.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_map.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-ppp.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-isup.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-bssgp.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-sgsap.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_a_rr.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_a_bssmap.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
packet-lte-rrc-fsm.obj : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_a_common.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-nas_eps.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-gsm_a_gm.obj) : error LNK2001: unresolved external symbol _match_strval_ext_init
dissectors.lib(packet-s1ap.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-tcap.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-frame.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-sccp.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_a_bssmap.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_map.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-isup.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_sms.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_bssmap_le.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_bsslap.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_a_rr.obj) : error LNK2001: unresolved external symbol col_append_str
dissectors.lib(packet-gsm_a_rp.obj) : error LNK2001: unresolved external symbol col_append_str
(01 Dec '15, 12:36) Viswanathan ...

The function you are calling (gsm_a_rr_rxlev_vals_ext, ...) are not exported, so you cannot call them from your external dll. They should either be declared as WS_DLL_PUBLIC in Wireshark source code (not likely to happen) or you should redefine them locally. Looks like you copy pasted the lte-rrc dissector code in your DLL. This does not seem to make a lot of sense to me. Again you should not link against dissectors.lib.

(01 Dec '15, 12:50) Pascal Quantin

the compilation is fine as it went through, the issue is with linking, i.e it is not allowing to call any function from epan\dissectors.

cl /DHAVE_WIN32_LIBWIRESHARK_LIB /D_NEED_VAR_IMPORT_ /WX /DHAVE_CONFIG_H /I../../.. /I../../../wiretap 
/IC:\wireshark-win64-libs-1.8\gtk2\include\glib-2.0  /IC:\wireshark-win64-libs-1.8\gtk2\lib\glib-2.0\include 
-DG_DISABLE_DEPRECATED  -DG_DISABLE_SINGLE_INCLUDES  
/IC:\wireshark-win64-libs-1.8\WPdpack\include -D_U_="" /Zi /W3 /MD /DWIN32_LEAN_AND_MEAN /DMSC_VER_REQUIRED=1600  
/D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /MP /GS -Fd.\ -c packet-lte-rrc-fsm.c plugin.c packet-lte-rrc-fsm.c plugin.c
link -dll /out:rrc-fsm.dll /NOLOGO /INCREMENTAL:no /DEBUG /MACHINE:x64 /DYNAMICBASE /FIXED:no
packet-lte-rrc-fsm.obj  plugin.obj ..\..\libwireshark.lib 
C:\wireshark-win64-libs-1.8\gtk2\lib\glib-2.0.lib  
C:\wireshark-win64-libs-1.8\gtk2\lib\gmodule-2.0.lib  
C:\wireshark-win64-libs-1.8\gtk2\lib\gobject-2.0.lib rrc-fsm.res
   Creating library rrc-fsm.lib and object rrc-fsm.exp
packet-lte-rrc-fsm.obj : error LNK2001: unresolved external symbol gsm_a_rr_rxlev_vals_ext
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol de_emm_sec_par_from_eutra referenced in function dissect_lte_rrc_T_nas_SecurityParamFromEUTRA
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol de_emm_sec_par_to_eutra referenced in function dissect_lte_rrc_T_nas_SecurityParamToEUTRA
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_Ellipsoid_Point_PDU referenced in function dissect_lte_rrc_T_ellipsoid_Point_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_EllipsoidPointWithAltitude_PDU referenced in function dissect_lte_rrc_T_ellipsoidPointWithAltitude_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_lpp_HorizontalVelocity_PDU referenced in function dissect_lte_rrc_T_horizontalVelocity_r10
packet-lte-rrc-fsm.obj : error LNK2019: unresolved external symbol dissect_rrc_InterRATHandoverInfo_PDU referenced in function dissect_lte_rrc_T_ueCapabilityRAT_Container
rrc-fsm.dll : fatal error LNK1120: 7 unresolved externals
(01 Dec '15, 15:42) Viswanathan ...

Note that @Viswanathan might be attempting to build an older version, maybe 1.8?

Can you clarify the source version you're working with?

The toolchain is VS2010.

(01 Dec '15, 15:56) grahamb ♦

I am using, 1.8.11

(01 Dec '15, 16:02) Viswanathan ...

Juts a info :I could able to compile & run the wireshark source code base 1.8.11 without any issue

(01 Dec '15, 16:06) Viswanathan ...
showing 5 of 6 show 1 more comments

0

the issue was resolved by - adding all export parameter libwireshark.def file & re compile - modifying the Makefile.nmake for remove the library ..\dissectors.lib in LINK_PLUGIN_WITH macro

answered 01 Dec '15, 17:41

Viswanathan%20Jagadeesan's gravatar image

Viswanathan ...
1112
accept rate: 0%

followup question, it does the creation of dissector dll for RRC successfully, when it loads on wireshark , it throws a error: "The procedure entry point dissect_lpp_Ellipsoid_Point_PDU could not be located in the dynamic link libwireshark.dll "

any suggestions.

(02 Dec '15, 14:26) Viswanathan ...