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

Filtering: Bitwise-and is leading to linker error

0

Hello,

I have tried to put bitwise-and(&) into the display filter Dialog box's sources, made proper and necessary changes that are required (like calling the bitwise-and related function (ftype_can_bitwise_and) from ftypes/ftypes.c same as the other operator functions are called). There are no compile-time errors but at the end I'm facing a linker error called :

Linking wireshark.exe
        link @C:\DOCUME~1\admin\LOCALS~1\Temp\nm1C1.tmp
libui.lib(dfilter_expr_dlg.obj) : error LNK2019: unresolved external symbol _ftype_can_trig referenced in function _show_relations
wireshark.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.

Please help.

This question is marked "community wiki".

asked 07 Oct '11, 00:18

Terrestrial%20shark's gravatar image

Terrestrial ...
96212829
accept rate: 42%

edited 07 Oct '11, 05:25

grahamb's gravatar image

grahamb ♦
19.8k330206


One Answer:

2

As I can't find the symbol ftype_can_trig anywhere in the svn tree for trunk nor in the function show_relations, I'm assuming this is something you've added.

If this is the case you will also need to add it to the list of exported functions in epan\libwireshark.def so that code outside of libwireshark can use it.

answered 07 Oct '11, 01:15

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

edited 07 Oct '11, 01:16

thanks Grahamb. Im trying to put triggers so i have defined a function called ftype_can_trig but it didnt allow. I have tried to add bitwise and as it is already present but not activated. Finally i made the code little messy.

(07 Oct '11, 01:23) Terrestrial ...

I have also include one of my variable from epan/ftypes/ftypes.h into the libwireshark.def but this isn't working. I followed the rules presented in that def file.

Code in ftypes.h typedef struct _a_b { int r; gint64 t; int tr; gint64 tri; }a_b;

WS_VAR_IMPORT a_b ab_struct;


Appended text in the libwireshark.def is

ab_struct DATA

Please Help!!

(07 Oct '11, 04:11) Terrestrial ...

I guess it's a linker error again about unresolved externals?

Are you sure you've rebuilt libwireshark as what you've done seems correct to me?

(07 Oct '11, 05:30) grahamb ♦

I have distcleaned and compiled it but this time there are no linker errors. Instead, I got the errors like:

ftype-integer.c

ftype-integer.c(258) : error C2037: left of 'tri' specifies undefined struct/union 'a_b'

ftype-integer.c(259) : error C2037: left of 'r' specifies undefine d struct/union 'a_b'

etc kind of Compile time errors.

(07 Oct '11, 23:30) Terrestrial ...
1

Basic c syntax errors then. This is probably better handled on the dev mailing list rather than the Q&A site. Post the relevant code and errors there. See here for more details

(08 Oct '11, 00:08) grahamb ♦

should i mail to [email protected] from my gmail account?

(08 Oct '11, 00:57) Terrestrial ...
showing 5 of 6 show 1 more comments