bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] Can't build libiconv-1.11 on Win32 using VC++ 6.0


From: Steve Hay
Subject: Re: [bug-gnu-libiconv] Can't build libiconv-1.11 on Win32 using VC++ 6.0
Date: Thu, 05 Jul 2007 09:48:37 +0100
User-agent: Thunderbird 2.0.0.4 (Windows/20070604)

Bruno Haible wrote:
The #include <stdint.h> line in unitypes.h was commented "Get uint8_t, uint16_t, uint32_t", but I can't see any MS VC++ 6.0 header file that contains these types, so there is no obvious replacement for stdint.h either.

Yes, Microsoft apparently ignores the ISO C 99 standard, by not providing
<stdbool.h> and <stdint.h> header files.

You can write a substitute stdint.h yourself; the comments tell you what
libiconv expects from it. The spec is at
http://www.opengroup.org/susv3/basedefs/stdint.h.html

Or you can use mingw instead of MSVC.

Or you can go back to libiconv-1.9.2, which did not require an <stdint.h>.

I've gone back to 1.9.2 for now, but clearly I don't want to get "stuck" on that version for ever more.

I'd prefer to stick with MSVC rather than MinGW if possible. Is libiconv going support MSVC in the future? Do you or any other developers have MSVC? I'm happy to help if I can be of any assistance.

The attached patch is the hacks that I've made so far, but now I get yet another error:

Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/out:iconv_no_i18n.exe
iconv_no_i18n.obj
../srclib/icrt.lib
../lib/iconv.lib
   Creating library iconv_no_i18n.lib and object iconv_no_i18n.exp
LINK : warning LNK4049: locally defined symbol "_program_name" imported
iconv_no_i18n.obj : error LNK2001: unresolved external symbol _uc_width
iconv_no_i18n.exe : fatal error LNK1120: 1 unresolved externals

--
Files libiconv-1.11.orig/src/iconv_no_i18n.exp and 
libiconv-1.11/src/iconv_no_i18n.exp differ
Files libiconv-1.11.orig/src/iconv_no_i18n.lib and 
libiconv-1.11/src/iconv_no_i18n.lib differ
diff -ruN libiconv-1.11.orig/srclib/progreloc.c libiconv-1.11/srclib/progreloc.c
--- libiconv-1.11.orig/srclib/progreloc.c       2006-05-17 11:12:44.000000000 
+0100
+++ libiconv-1.11/srclib/progreloc.c    2007-07-05 09:35:17.945388000 +0100
@@ -49,6 +49,10 @@
 # include <windows.h>
 #endif
 
+#ifdef _MSC_VER
+# define EXEEXT ".exe"
+#endif
+
 #include "xreadlink.h"
 #include "canonicalize.h"
 #include "relocatable.h"
diff -ruN libiconv-1.11.orig/srclib/unitypes.h libiconv-1.11/srclib/unitypes.h
--- libiconv-1.11.orig/srclib/unitypes.h        2005-05-19 17:58:24.000000000 
+0100
+++ libiconv-1.11/srclib/unitypes.h     2007-07-05 09:36:43.195933600 +0100
@@ -20,7 +20,13 @@
 #define _UNITYPES_H
 
 /* Get uint8_t, uint16_t, uint32_t.  */
-#include <stdint.h>
+#ifdef _MSC_VER
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned long uint32_t;
+#else
+# include <stdint.h>
+#endif
 
 /* Type representing a Unicode character.  */
 typedef uint32_t ucs4_t;
diff -ruN libiconv-1.11.orig/srclib/unsetenv.c libiconv-1.11/srclib/unsetenv.c
--- libiconv-1.11.orig/srclib/unsetenv.c        2006-06-17 16:51:52.000000000 
+0100
+++ libiconv-1.11/srclib/unsetenv.c     2007-07-05 09:35:37.039260200 +0100
@@ -27,7 +27,9 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
 #if !_LIBC
 # define __environ     environ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]