Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borland 5.0A & winsock2.h

Status
Not open for further replies.

marsss

Programmer
Sep 24, 2004
116
US
Hello, i m use to work with VS6+ when I work with socket, but I got a project stuck with Borland 5.

I m trying to use winsock2.h, but i m having some problem to get it work.

Since I didn t had anything bout winsock2.h within my Borland file, I did try to find something bout it for Borland but haven t found anything. So I got "Microsoft Platform SDK for Windows Server 2003 R2" which have all kind stuff i Need in it. I made sure to include library and include path in my project to use these winsock2 files.

My soft do nothing at all atm, just trying to include that winsock2.h file :

Code:
#include <winsock2.h>
#include <ws2tcpip.h>

int main(void)
{
    return 0;
}

I m getting error when i try to build up my project when it get to point of including winsock2.h such like this :

Code:
Error:WINSOCK2.H(91,33):, expected
Error:WINSOCK2.H(98,31):, expected
Error:WINSOCK2.H(114,25):Type name expected
Error:WINSOCK2.H(114,25):Declaration missing ;
Warn :WINSOCK2.H(117,43):Style of function definition is now obsolete
Error:WINSOCK2.H(117,56):, expected
Error:WINSOCK2.H(1222,32):Type name expected
Error:WINSOCK2.H(1266,26):Type name expected
Error:WINSOCK2.H(1266,26):Declaration missing ;
Error:WINSOCK2.H(1621,7):extern variable cannot be initialized
Error:WINSOCK2.H(1621,7):Declaration syntax error
Error:WINSOCK2.H(1644,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1665,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1682,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1703,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1724,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1745,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1766,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1859,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1912,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1935,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(1987,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(2010,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(2037,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(2062,14):'SOCKET' cannot start a parameter declaration
Error:WINSOCK2.H(2079,7):extern variable cannot be initialized
Error:WINSOCK2.H(2079,7):Too many error or warning messages

I have try many thing and I m realy clueless why it wont work...

when i look inside winsock2.h, it get into error at this line :
Code:
typedef unsigned __int64 u_int64;
Just after u_int64

I m running on win XP Pro SP2

So, is it because i m using wrong file to make winsock2 work, is it because I haven t link well my stuff... I kinda need some input plz
 
I can think of two possible problems. First, winsock2.h is corrupt. You say you looked into the file, how did you do that? Did you use an editor? If so, I would say this is the problem.

The next problem deals with the compiler you are using. I don't remember if version 5.0A will handle Win32 or not. Just why are you using such an old version? Have you tried Borland's free compiler? Their 5.5 compiler is free (Compiler only, not the IDE). See for more info.

You can also try their newest Turbo compiler (


James P. Cottingham
-----------------------------------------
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
I did figure that my project is built as 32bits, and that s why it doesn t support the 64bits stuff in winsock2.h
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top