[sr #107827] Build GnuTLS 3.0.2 for windows!

Bjørn Christensen bhc at insight.dk
Tue Oct 4 14:31:17 CEST 2011


The problem was solve by adding an #undef select ,  to  let system.c actually find the definition from winsock2.h.

 

There must be a #define somewhere to set select to 'select_used_without_including_sys_select_h' to warn that it have not been define probably,

 

 

/bhc

 

 

 

From: Vincent Torri [mailto:vincent.torri at gmail.com] 
Sent: 4. oktober 2011 14:23
To: Bjørn Christensen
Cc: Nikos Mavrogiannopoulos; Nikos Mavrogiannopoulos; gnutls-devel at gnu.org
Subject: Re: [sr #107827] Build GnuTLS 3.0.2 for windows!

 

 

2011/10/4 Bjørn Christensen <bhc at insight.dk>

<sys/select.h> is not available under windows, it tried with <winsock2.h> where select in define for windows but it did not help.


use MSDN:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141%28v=vs.85%29.aspx

select() is declared when winsock2.h is included.

header : winsock2.h
lib : libws2_32
 
I don't understand why there are problems. I use select() for a project I'm working on without any issue. I just include winsock2.h on Windows:

#ifdef _WIN32
# include <winsock2.h>
#endif

and that's all (or add a check in configure.ac and guard it with HAVE_WINSOCK2_H)

	
	If I add <sys/select.h> I get file not found.


this file does not exist on Windows.
 
Vincent Torri

	
	
	
	I can see that the old gcrypt.h had a forward declarations for select, but now where we have moved to nettle gcrypt.h is not included any more.
	
	I am sure that the declaration of select is in the winsock2.h
	
	The declaration of select is cover by a:
	#if ! (defined (__INSIDE_CYGWIN__) || defined (__INSIDE_MSYS__))
	
	
	Which is not is not the case. I do not know what that means.
	
	
	I can solve the problem by in the #ifdef _WIN32 section of system.c  include the winsock2.h and add a forward declaration for select. (stolen from gcrypt.h)
	
	#ifdef _WIN32
	#include <windows.h>
	
	#include <winsock2.h>
	ssize_t (*select) (int nfd, void *rset, void *wset, void *eset, struct timeval *timeout);
	
	#else
	
	That is not a nice solution but it works.
	
	Better suggestions are appreciated
	
	
	/bhc
	
	
	PS: --disable-cxx worked.
	
	Thanks!
	
	
	
	-----Original Message-----
	From: Nikos Mavrogiannopoulos [mailto:INVALID.NOREPLY at gnu.org]
	Sent: 3. oktober 2011 23:19
	To: Nikos Mavrogiannopoulos; Bjørn Christensen; gnutls-devel at gnu.org
	Subject: [sr #107827] Build GnuTLS 3.0.2 for windows!
	
	Follow-up Comment #12, sr #107827 (project gnutls):
	
	You can use ./configure --disable-cxx
	to disable the C++ library.
	
	About the select issue, if you add an include <sys/select.h> does it work?
	
	
	   _______________________________________________________
	
	Reply to this item at:
	
	 <http://savannah.gnu.org/support/?107827>
	
	_______________________________________________
	 Message sent via/by Savannah
	 http://savannah.gnu.org/
	
	_______________________________________________
	Gnutls-devel mailing list
	Gnutls-devel at gnu.org
	https://lists.gnu.org/mailman/listinfo/gnutls-devel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20111004/40bd7fc3/attachment.htm>


More information about the Gnutls-devel mailing list