|
Hi All, Recently I began to work with Wireshark, so I have little experience with the "plugin" environment or setup. When I attempted to install the plugin by building Wireshark, I got the following errors. Could someone tell me what I'm doing wrong and/or what I can do to fix it? Thanks! Ian
[non-relevant errors snipped for brevity]
|
|
From the first error line you seem to be missing the path to glibconfig.h that has the definition of guint32. I suspect that your build environment is't set up correctly. Have you followed all the steps in the Developers Guide for Win32 builds exactly as laid out? Thanks for that note, corrected that and half of the errors disappeared.
(11 Jun '12, 12:12)
Ian
Okay, however, ...
is still coming back as an improper use of the guint8 variable, why would this be? A previous use of guint8...
did indeed work, but why wouldn't the former line?
(11 Jun '12, 12:30)
Ian
What's the exact error message for the error? It's always best to ensure you can compile a standard copy of Wireshark before you try to add anything new. Have you managed that?
(11 Jun '12, 13:10)
grahamb ♦
I have indeed, and everything works fine, but this is the first plugin from scratch for me.
(11 Jun '12, 13:22)
Ian
Possibly missing a statement terminator on the previous line? Can you post a bit of context for the erroring statement?
(11 Jun '12, 13:28)
grahamb ♦
Can't see the issue :-( Is flags declared earlier in the function? When stuck like this I just comment out bits until I find what the compiler is upset about.
(11 Jun '12, 13:54)
grahamb ♦
Ya, I did mass chunks of commenting and it compiled for the first time :) I'll keep at it, thanks!
(11 Jun '12, 14:03)
Ian
I think Anders nailed it. You can't declare flags there.
(11 Jun '12, 15:56)
cmaynard ♦
While this is true for .c files (I think this is part of the C standard), the usual VS error for this is: Using this file:
Gives the output:
The error is the same for VS2005 & VS2010
(12 Jun '12, 02:12)
grahamb ♦
if you compile that with
Seems to be the C90 standard. gcc accepts the code and does only warn with -pedantic.
(12 Jun '12, 02:44)
Kurt Knochner
And that's why we declare all vars in dissectors at the start of the function, for portability. From the Developers Guide (1.1.1 Portability): Don't declare variables in the middle of executable code; not all C compilers support that. Variables should be declared outside a function, or at the beginning of a function or compound statement. Still not sure why the OP is getting a different error though.
(12 Jun '12, 03:08)
grahamb ♦
hard to say without the code. I assume your previous statement ("Possibly missing a statement terminator") nails it down, as uncommenting large parts of the code "fixes" the problem.
(12 Jun '12, 05:13)
Kurt Knochner
Got it to work, thanks guys :)
(12 Jun '12, 07:16)
Ian
what was the problem?
(12 Jun '12, 07:29)
Kurt Knochner
What Graham said basically summed it up: VS didn't like me putting declarations within functions themselves, so I declared all vars that were giving me errors at the beginning :)
(12 Jun '12, 07:35)
Ian
showing 5 of 15
show 10 more comments
|
|
There is a syntax error in your code either before or with the include statement for
Please post 10-20 lines of your code in front of the include statement. Regards Hi Kurt, Thanks for replying so quickly, here's the lines. ifdef HAVE_CONFIG_Hinclude "config.h"endif/ Include only as needed / include <stdio.h>include <gmodule.h>include <stdlib.h>include <string.h>include <glib.h>include <epan packet.h="">include <epan prefs.h="">include <epan emem.h="">include <epan reassemble.h="">
(11 Jun '12, 12:09)
Ian
the last include statements look pretty strange, but I guess that's just a copy-paste error with the Q&A site, right?
(11 Jun '12, 12:51)
Kurt Knochner
Ya, it should be: include <epan.reassemble.h> with the # in front
(11 Jun '12, 13:23)
Ian
1
Windows does not like declarations in the middle of the code, is that what you are doing?
(11 Jun '12, 13:45)
Anders ♦
These are declarations at the top of the plugin I'm trying to write, and I was showing Kurt that the include statements should be correct.
(11 Jun '12, 13:54)
Ian
Loose the gmodule.h include.
(12 Jun '12, 05:45)
Jaap ♦
showing 5 of 6
show 1 more comments
|
