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 But when I add it into Wireshark, there are many errors related to missing lib as shown below 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 edited 18 Sep '13, 02:56 |
2 Answers:
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 |
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 ♦ |
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
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 :
Problem solved. Thanks , all :-)
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.