[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sys_ioctl, sys_select: fix link errors
From: |
Bruno Haible |
Subject: |
sys_ioctl, sys_select: fix link errors |
Date: |
Sun, 28 Mar 2010 13:22:09 +0100 |
User-agent: |
KMail/1.9.9 |
On mingw, I get link errors:
g++ -mno-cygwin -L/usr/local/mingw/lib -o test-sys_ioctl-c++.exe
test-sys_ioctl-c++.o ../gllib/libgnu.a
test-sys_ioctl-c++.o:test-sys_ioctl-c++.cc:(.data+0x4): undefined reference to
`_ioctl'
collect2: ld returned 1 exit status
make[4]: *** [test-sys_ioctl-c++.exe] Error 1
Then later:
g++ -mno-cygwin -L/usr/local/mingw/lib -o test-sys_ioctl-c++.exe
test-sys_ioctl-c++.o ../gllib/libgnu.a
../gllib/libgnu.a(ioctl.o): In function `rpl_ioctl':
/home/bruno/testdir1/gllib/ioctl.c:46: undefined reference to address@hidden'
../gllib/libgnu.a(ioctl.o): In function `rpl_ioctl':
/home/bruno/testdir1/gllib/w32sock.h:34: undefined reference to address@hidden'
collect2: ld returned 1 exit status
make[4]: *** [test-sys_ioctl-c++.exe] Error 1
and:
g++ -mno-cygwin -L/usr/local/mingw/lib -o test-sys_select-c++.exe
test-sys_select-c++.o ../gllib/libgnu.a
../gllib/libgnu.a(select.o): In function `rpl_select':
/home/bruno/testdir1/gllib/select.c:93: undefined reference to address@hidden'
/home/bruno/testdir1/gllib/select.c:360: undefined reference to address@hidden'
/home/bruno/testdir1/gllib/select.c:381: undefined reference to address@hidden'
...
collect2: ld returned 1 exit status
make[4]: *** [test-sys_select-c++.exe] Error 1
This patch fixes all three errors.
2010-03-28 Bruno Haible <address@hidden>
Fix link errors on mingw.
* lib/sys_ioctl.in.h (ioctl): Fix declaration idiom.
* modules/sys_ioctl-tests (Makefile.am): Link test-sys_ioctl-c++ with
$(LIBSOCKET).
* modules/sys_select-tests (Makefile.am): Link test-sys_select-c++ with
$(LIBSOCKET).
--- lib/sys_ioctl.in.h.orig Sun Mar 28 14:16:35 2010
+++ lib/sys_ioctl.in.h Sun Mar 28 14:10:17 2010
@@ -49,13 +49,18 @@
# undef ioctl
# define ioctl rpl_ioctl
# endif
+_GL_FUNCDECL_RPL (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+_GL_CXXALIAS_RPL (ioctl, int,
+ (int fd, int request, ... /* {void *,char *} arg */));
+# else
_GL_FUNCDECL_SYS (ioctl, int,
(int fd, int request, ... /* {void *,char *} arg */));
-# endif
/* Need to cast, because on glibc systems, the second parameter is
unsigned long int request. */
_GL_CXXALIAS_SYS_CAST (ioctl, int,
(int fd, int request, ... /* {void *,char *} arg */));
+# endif
_GL_CXXALIASWARN (ioctl);
#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
# undef ioctl
--- modules/sys_ioctl-tests.orig Sun Mar 28 14:16:35 2010
+++ modules/sys_ioctl-tests Sun Mar 28 14:13:55 2010
@@ -15,5 +15,5 @@
TESTS += test-sys_ioctl-c++
check_PROGRAMS += test-sys_ioctl-c++
test_sys_ioctl_c___SOURCES = test-sys_ioctl-c++.cc
-test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME)
+test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET)
$(LIB_CLOCK_GETTIME)
endif
--- modules/sys_select-tests.orig Sun Mar 28 14:16:35 2010
+++ modules/sys_select-tests Sun Mar 28 14:15:13 2010
@@ -15,5 +15,5 @@
TESTS += test-sys_select-c++
check_PROGRAMS += test-sys_select-c++
test_sys_select_c___SOURCES = test-sys_select-c++.cc
-test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
+test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_NANOSLEEP)
endif
- sys_ioctl, sys_select: fix link errors,
Bruno Haible <=