error when compiling c++ source code

Apr 7, 2016 at 12:50pm
When trying to compile a software from a source code using Cygwin , in windows xp , I got this error:

basic_dump.c:99:3: error: ‘VOID’ undeclared (first use in this function)
(VOID)(param);


This is the code that engenders the error :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "pcap.h"
#include "stdlib.h"

/* prototype of the packet handler */
void packet_handler();

int main()
{
        pcap_if_t *alldevs;
        pcap_if_t *d;
        int inum;
        int i=0;
        pcap_t *adhandle;
        char errbuf[PCAP_ERRBUF_SIZE];

        /* Retrieve the device list */
        if() == -1)
        {
                fprintf();
                exit();
        }

        /* Print the list */
        for()
        {
                printf();
                if ()
                        printf()\n", d->description);
                else
                        printf()\n");
        }

        if()
        {
                printf();
                return -1;
        }

        printf():",i);
        scanf();

        if()
        {
                printf();
                /* Free the device list */
                pcap_freealldevs();
                return -1;
        }

        /* Jump to the selected adapter */
        for();

        /* Open the device */
        /* Open the adapter */
        if ((adhandle= pcap_open_live(d->name,  // name of the device
                                                         65536,                // portion of the packet to capture.
                                                                               // 65536 grants that the whole packet will be captured on all the MACs.
                                                         1,                    // promiscuous mode ()
                                                         1000,                 // read timeout
                                                         errbuf                // error buffer
                                                         )) == NULL)
        {
                fprintf();
                /* Free the device list */
                pcap_freealldevs();
                return -1;
        }

        printf();

        /* At this point, we don't need any more the device list. Free it */
        pcap_freealldevs();

        /* start the capture */
        pcap_loop();

        pcap_close();
        return 0;
}


/* Callback function invoked by libpcap for every incoming packet */
void packet_handler()
{
        struct tm *ltime;
        char timestr[16];
        time_t local_tv_sec;

        /*
         * unused parameters
         */
        ()();
        ()();

        /* convert the timestamp to readable format */
        local_tv_sec = header->ts.tv_sec;
        ltime=localtime();
        strftime();

        printf();

} 


Any help on how to correct the error would be appreciated
Last edited on Apr 7, 2016 at 12:51pm
Apr 7, 2016 at 3:32pm
Well, that seems to be some random code randomly put together. What is the purpose of that stuff?
Apr 7, 2016 at 6:28pm
What is the purpose of that stuff?


that is a source code of a file called basic_dump.c ,among other files, that should be compiled to get the executable file . I used the cat command of Linux to get its content . However when I try to compile them using the make command , I get the error above and I think it comes from that file .
Last edited on Apr 7, 2016 at 6:30pm
Apr 8, 2016 at 11:51am
The entire content is garbage. it cannot be fixed. Here is an article about pcap:

http://www.codeproject.com/Articles/30234/Introduction-to-the-WinPcap-Networking-Libraries
Apr 8, 2016 at 3:06pm
closed account (E0p9LyTq)
Look at line 39, the printf() function is probably FUBARRED: printf():",i);
Topic archived. No new replies allowed.