Hi all,

I'm new to using Visual Studio. I'm currently using VS .NET 2003 on Vista, and I'm trying to port a program from Linux to Windows.

The program uses the pcap library. I have installed WinPcap 4.0.2 and downloaded the Developer's Pack WpdPack_4_0_2. However, I have no idea what to do with the developer's pack, i.e. what do I do with the pcap.h and other header files/libraries so my program can use the pcap functions.

Also, one of the errors I've gotten was that the file dirent.h cannot
be found. Is there some way to workaround this problem, i.e. some
library that I can download and use so I don't have to change my code? If not, what are the alternatives?

Lastly, I seem to get a lot of syntax errors. The program was able to
compile and run without errors in Linux. One of these errors are
"error C2085: '<function name>': not in formal parameter list." These errors occur in the header file which is in the following format:

#ifndef HEADER_H
#define HEADER_H

/* Bunch of #include and #define statements */
/* Struct declarations */

/* Here's where the errors are */
static void *Function1(int n);
int Function2(ABC *x);  //ABC is a self-defined structure declared in
this header file
ABC *Function3(void *a);
static inline void Function4(unsigned char *c, unsigned char *d, int
e);

/* There is also a C2061: syntax error: identifier 'inline' for the
following line */
inline int Function5(ABC *x, unsigned char *f, int g);

#endif

Please advise.

Thank you.

Regards,
Rayne

>>I'm new to using Visual Studio. I'm currently using VS .NET 2003 on Vista

Upgrade to VC++ 2008. You can get free Express version. CLR and MSDN was changed quite a bit since 2003.

Not sure why direct.h could not be found. Did you use angle brackets instead of quotes? such as #include <direct.h> Questions about WinPCap should be directed to their support group. We are in no position to provide that type of technical support.


inline VC++ 2008 supports inline only for C++ programs. In C programs using __inline

As for the last problem(s) you will need to post the entire file. If its pretty large then zip it up and attach it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.