evonmj
June 6th, 2008, 05:19 PM
Hello, I am writing a simple Socket program using visual studio 2005, under windows xp, I create a console project, and the following is the piece of code.
#include <Winsock2.h>
int main()
{
SOCKET s = socket(PF_INET, SOCK_STREAM, 0);
}
I add Ws2_32.lib already, but it always return -1 as output, what is wrong with the code, any help will be appreciated.
Jimmy
#include <Winsock2.h>
int main()
{
SOCKET s = socket(PF_INET, SOCK_STREAM, 0);
}
I add Ws2_32.lib already, but it always return -1 as output, what is wrong with the code, any help will be appreciated.
Jimmy