Abdelrazak Younes a écrit :
Abdelrazak Younes a écrit :
While looking for an updated gettext library I came across this:

http://gnuwin32.sourceforge.net/packages/libgw32c.htm

It seems that there's a possibility to also provide fork and socket to mingw (so that the client might work). I'll test this and report afterword.

The configure went OK, except for this:

With the attached (ugly and non-portable) patch I managed to compile everything but I still get some linking errors:

$ g++ -O3 -w -o lyxclient.exe boost.o client.o debug.o gettext.o messages.o -Ld:/mingw/lib -Ld:/program/Aspell-0.60.4/lib ../../src/support/.libs/libsupport.a -lshlwapi ../../boost/libs/regex/src/.libs/libboost_regex.a ../../boost/libs/filesystem/src/.libs/libboost_filesystem.a -lintl -liconv -lgw32c -lole32 -luuid -lwsock32
client.o:client.C:(.text+0x3c0): undefined reference to `socket'
client.o:client.C:(.text+0x3e6): undefined reference to `connect'
collect2: ld returned 1 exit status

I have played the nm and grep game to look for those two functions and as far as I see they are defined in "libwsock32.a":

$ nm libwsock32.a | grep socket
00000000 I [EMAIL PROTECTED]
00000000 T [EMAIL PROTECTED]
00000000 I [EMAIL PROTECTED]
00000000 T [EMAIL PROTECTED]
00000000 I [EMAIL PROTECTED]
00000000 T [EMAIL PROTECTED]

[EMAIL PROTECTED] /cygdrive/d/mingw/lib
$ nm libwsock32.a | grep connect
00000000 I [EMAIL PROTECTED]
00000000 T [EMAIL PROTECTED]

I am giving up for now, but I guess it should be possible to compile it successfully. The question is, is it useful? (Don't tell me that you already got that with cygwin Enrico ;-)) A better solution would be to use a new boost library that provide sockets over TCP but it is more work.

Abdel.

Index: client.C
===================================================================
--- client.C    (revision 13831)
+++ client.C    (working copy)
@@ -24,7 +24,8 @@
 # include <sys/types.h>
 #endif
 #ifdef HAVE_UNISTD_H
-# include <unistd.h>
+# define __ssize_t_defined
+# include <glibc/unistd.h>
 #endif
 
 // struct timeval
@@ -34,6 +35,8 @@
 
 // select()
 #ifdef HAVE_SYS_SELECT_H
+# define __sigset_t_defined
+# define _STRUCT_TIMEVAL       1
 # include <sys/select.h>
 #endif
 
@@ -44,7 +47,9 @@
 #include <sys/un.h>
 
 // fcntl()
-#include <fcntl.h>
+#define __USE_FILE_OFFSET64
+#undef __REDIRECT
+#include <glibc/fcntl.h>
 
 #include <cerrno>
 #include <cstdlib>

Reply via email to