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

[SOLVED] Missing Lib of Socket while building Wireshark

0

Hi all, I'm adding a program of socket processing into WireShark source code in order to send data to server. I wrote a C program by Visual Studio 2010 and it runs well with the library for socket as below

alt text

But when I add it into Wireshark, there are many errors related to missing lib as shown below

alt text

I don't know how to fix these errors, do we have anything to replace "pragma comment ..." or do something to let the program be able to find out the lib? Please help if you have any idea or suggestion. Thank you so much and have a nice weekend.

asked 13 Sep '13, 02:34

hoangsonk49's gravatar image

hoangsonk49
81282933
accept rate: 28%

edited 18 Sep '13, 02:56


2 Answers:

0

They are differences between C and C++. I tried the program with VS 2010 C++ while Wireshark use .C, so I just made some modifications to match the format of C languages, in which all variables must be declared at the beginning of the block {}. Then, it works.

answered 04 Nov '13, 23:28

hoangsonk49's gravatar image

hoangsonk49
81282933
accept rate: 28%

1

The problem isn't one of missing libraries, but missing (or incorrect) includes. The compiler is complaining about missing definitions. This may be because those new includes require some definitions to be made before including them.

When you do manage to get compilation working then the "#pragma comment" entries may or may not allow the linker to find the required libraries. If they don't, then you will need to modify the Makefile to pass the required libs to the linker.

answered 13 Sep '13, 03:03

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Problem solved. Thanks, grhamb. But there are some errors which are unbelievable because I checked on VS 2010 successfully but I don't know why it appears as a stupid mistake (or I'm stupid ( !). Please see the picture as below. Thanks

(13 Sep '13, 03:57) hoangsonk49

The source is attached here link text

And this is an error. I try to add the function attached above into packet-camel.c but it shows the results :

alt text

(13 Sep '13, 04:04) hoangsonk49

Problem solved. Thanks , all :-)

(15 Sep '13, 19:57) hoangsonk49

And how was the problem solved, for the benefit of others?

If you can't provide an answer then we might as well delete the question as it's of no use to anyone else.

(16 Sep '13, 01:34) grahamb ♦