troubleshooting Question

wspiapi.h: reference to a zero-sized array is illegal

Avatar of bigga
bigga asked on
System Programming
7 Comments1 Solution2454 ViewsLast Modified:
Hi,

I have a problem compiling a program in VC++ 6.0

I have downloaded this Netstatp source code from http://www.sysinternals.com/Utilities/TcpView.html to study how to map port number to process whose it belongs.

However, I had a problem with "iphlpapi.h".
After I searched through google and experts-exchange, the solution is that I had to install MS Platform SDK which I did.

After installation, I went to VC++ Options setting in the menu Tools and move "include", "lib" and "src" dirs of the installed SDK into the top of the dir list.
(So VC++ will search for the files from SDK first.)

After I did that, I can compile the Netstatp code which I have downloaded, but when I tried to compile my OLD code, it doesnt work.
My old code uses pcap to monitor the traffic on the local machine.
(And I which to map the packets captured to their owners based on port numbers.)

The problem is, when I compile, I got this error message:

c:\program files\microsoft platform sdk\include\wspiapi.h(45) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
c:\program files\microsoft platform sdk\include\wspiapi.h(45) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal

And they always occurred twice as shown.

I suspect that new version of wspiapi.h might not compatible with my environment somehow but I do not know how to fix.

Anyone has suggestions on this?
Thanks in advance!
ASKER CERTIFIED SOLUTION
modulo

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros