Porting cpIRC to work with windows

I am creating an irc bot and using cpIRC as a wrapper. Everything works on linux, but when compiling on windows and linking to ws2_32.lib the program spits out "Failed to open streams!";

Here is the code from the wrapper responsible for the error:
1
2
3
4
5
6
7
8
9
	dataout=fdopen(irc_socket, "w");
	//datain=fdopen(irc_socket, "r");
	
	if (!dataout /*|| !datain*/)
	{
		printf("Failed to open streams!\n");
		closesocket(irc_socket);
		return 1;
	}


Apparently fdopen does not work with windows sockets: http://www.cygwin.com/ml/cygwin/1999-08/msg00413.html

Is there any way to port this code to work with Windows Sockets not using cygwin?

Here is the wrapper I am using: http://www.nongnu.org/cpirc/
and here is a short tutorial on how to use it: http://www.nongnu.org/cpirc/cpIRC.html

Thanks.
closed account (DSLq5Di1)
These links may be of use to you:-
http://msdn.microsoft.com/en-us/library/bdts1c9x.aspx
http://www.halcyon.com/~ast/dload/guicon.htm
I just decided to compile with cygwin's toolchain. It works but now I have to package the cygwin.dll with it.
Topic archived. No new replies allowed.