
Hi, so I've been working with System.IO.UTF8 trying to get it to render Japanese characters correctly. Using just IO I've gotten it to output the correct unicode values, however, replacing the IO.putStrLn commands with System.IO.UTF8 yielded some strange errors. I went through the program and replaced the System.IO.UTF8 putStrLn and hGetLine commands with their "normal" IO counterparts, however, simply having the "import System.IO.UTF8" line at the beginning of the file causes an error during compilation. $ghc file.hs compilation IS NOT required byteindex.o: In function `sKE_info': (.text+0x8bf): undefined reference to `__stginit_utf8zmstringzm0zi3zi3_SystemziIOziUTF8_' collect2: ld returned 1 exit status Below is the output of ghc -v. I am running Ubuntu 7.10 gutsy. I have been getting the same error whether GHC was compiled from binaries or source. Currently I am running GHC (version 6.8.3) compiled from source. $ ghc -v file.hs Glasgow Haskell Compiler, Version 6.8.3, for Haskell 98, stage 2 booted by GHC version 6.8.3 Using package config file: /usr/local/lib/ghc-6.8.3/package.conf wired-in package base mapped to base-3.0.2.0 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0.1.0 wired-in package template-haskell mapped to template-haskell-2.2.0.0 wired-in package ndp not found. Hsc static flags: -static Created temporary directory: /tmp/ghc6586_0 *** Checking old interface for main:Main: compilation IS NOT required *** Touching object file: touch byteindex.o *** Linker: gcc -v -o a.out -DDONT_WANT_WIN32_DLL_SUPPORT byteindex.o -L/usr/local/lib/ghc-6.8.3/lib/haskell98-1.0.1.0 -L/usr/local/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/usr/local/lib/ghc-6.8.3/lib/process-1.0.0.1 -L/usr/local/lib/ghc-6.8.3/lib/unix-2.3.0.1 -L/usr/local/lib/ghc-6.8.3/lib/random-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/directory-1.0.0.1 -L/usr/local/lib/ghc-6.8.3/lib/filepath-1.1.0.0 -L/usr/local/lib/ghc-6.8.3/lib/old-time-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/old-locale-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/usr/local/lib/ghc-6.8.3 -lHShaskell98-1.0.1.0 -lHSarray-0.1.0.0 -lHSprocess-1.0.0.1 -lHSunix-2.3.0.1 -lutil -ldl -lHSrandom-1.0.0.0 -lHSdirectory-1.0.0.1 -lHSfilepath-1.1.0.0 -lHSold-time-1.0.0.0 -lHSold-locale-1.0.0.0 -lHSbase-3.0.2.0 -lHSrts -lm -lgmp -ldl -lrt -u base_GHCziBase_Izh_static_info -u base_GHCziBase_Czh_static_info -u base_GHCziFloat_Fzh_static_info -u base_GHCziFloat_Dzh_static_info -u base_GHCziPtr_Ptr_static_info -u base_GHCziWord_Wzh_static_info -u base_GHCziInt_I8zh_static_info -u base_GHCziInt_I16zh_static_info -u base_GHCziInt_I32zh_static_info -u base_GHCziInt_I64zh_static_info -u base_GHCziWord_W8zh_static_info -u base_GHCziWord_W16zh_static_info -u base_GHCziWord_W32zh_static_info -u base_GHCziWord_W64zh_static_info -u base_GHCziStable_StablePtr_static_info -u base_GHCziBase_Izh_con_info -u base_GHCziBase_Czh_con_info -u base_GHCziFloat_Fzh_con_info -u base_GHCziFloat_Dzh_con_info -u base_GHCziPtr_Ptr_con_info -u base_GHCziPtr_FunPtr_con_info -u base_GHCziStable_StablePtr_con_info -u base_GHCziBase_False_closure -u base_GHCziBase_True_closure -u base_GHCziPack_unpackCString_closure -u base_GHCziIOBase_stackOverflow_closure -u base_GHCziIOBase_heapOverflow_closure -u base_GHCziIOBase_NonTermination_closure -u base_GHCziIOBase_BlockedOnDeadMVar_closure -u base_GHCziIOBase_BlockedIndefinitely_closure -u base_GHCziIOBase_Deadlock_closure -u base_GHCziIOBase_NestedAtomically_closure -u base_GHCziWeak_runFinalizzerBatch_closure -u base_GHCziConc_ensureIOManagerIsRunning_closure Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.1.3 --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu Thread model: posix gcc version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2) /usr/lib/gcc/i486-linux-gnu/4.1.3/collect2 --eh-frame-hdr -m elf_i386 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o a.out -u base_GHCziBase_Izh_static_info -u base_GHCziBase_Czh_static_info -u base_GHCziFloat_Fzh_static_info -u base_GHCziFloat_Dzh_static_info -u base_GHCziPtr_Ptr_static_info -u base_GHCziWord_Wzh_static_info -u base_GHCziInt_I8zh_static_info -u base_GHCziInt_I16zh_static_info -u base_GHCziInt_I32zh_static_info -u base_GHCziInt_I64zh_static_info -u base_GHCziWord_W8zh_static_info -u base_GHCziWord_W16zh_static_info -u base_GHCziWord_W32zh_static_info -u base_GHCziWord_W64zh_static_info -u base_GHCziStable_StablePtr_static_info -u base_GHCziBase_Izh_con_info -u base_GHCziBase_Czh_con_info -u base_GHCziFloat_Fzh_con_info -u base_GHCziFloat_Dzh_con_info -u base_GHCziPtr_Ptr_con_info -u base_GHCziPtr_FunPtr_con_info -u base_GHCziStable_StablePtr_con_info -u base_GHCziBase_False_closure -u base_GHCziBase_True_closure -u base_GHCziPack_unpackCString_closure -u base_GHCziIOBase_stackOverflow_closure -u base_GHCziIOBase_heapOverflow_closure -u base_GHCziIOBase_NonTermination_closure -u base_GHCziIOBase_BlockedOnDeadMVar_closure -u base_GHCziIOBase_BlockedIndefinitely_closure -u base_GHCziIOBase_Deadlock_closure -u base_GHCziIOBase_NestedAtomically_closure -u base_GHCziWeak_runFinalizzerBatch_closure -u base_GHCziConc_ensureIOManagerIsRunning_closure /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.3/crtbegin.o -L/usr/local/lib/ghc-6.8.3/lib/haskell98-1.0.1.0 -L/usr/local/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/usr/local/lib/ghc-6.8.3/lib/process-1.0.0.1 -L/usr/local/lib/ghc-6.8.3/lib/unix-2.3.0.1 -L/usr/local/lib/ghc-6.8.3/lib/random-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/directory-1.0.0.1 -L/usr/local/lib/ghc-6.8.3/lib/filepath-1.1.0.0 -L/usr/local/lib/ghc-6.8.3/lib/old-time-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/old-locale-1.0.0.0 -L/usr/local/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/usr/local/lib/ghc-6.8.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3 -L/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib byteindex.o -lHShaskell98-1.0.1.0 -lHSarray-0.1.0.0 -lHSprocess-1.0.0.1 -lHSunix-2.3.0.1 -lutil -ldl -lHSrandom-1.0.0.0 -lHSdirectory-1.0.0.1 -lHSfilepath-1.1.0.0 -lHSold-time-1.0.0.0 -lHSold-locale-1.0.0.0 -lHSbase-3.0.2.0 -lHSrts -lm -lgmp -ldl -lrt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i486-linux-gnu/4.1.3/crtend.o /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crtn.o byteindex.o: In function `sKE_info': (.text+0x8bf): undefined reference to `__stginit_utf8zmstringzm0zi3zi3_SystemziIOziUTF8_' collect2: ld returned 1 exit status *** Deleting temp files: Deleting: /tmp/ghc6586_0/ghc6586_0.s Warning: deleting non-existent /tmp/ghc6586_0/ghc6586_0.s *** Deleting temp dirs: Deleting: /tmp/ghc6586_0 Any help would be greatly appreciated. -- Ben George blgeorge@fastmail.fm -- http://www.fastmail.fm - The way an email service should be

On 2008 Dec 2, at 0:38, Ben George wrote:
$ghc file.hs compilation IS NOT required byteindex.o: In function `sKE_info': (.text+0x8bf): undefined reference to `__stginit_utf8zmstringzm0zi3zi3_SystemziIOziUTF8_' collect2: ld returned 1 exit status
Use ghc --make so it looks up the dependencies for System.IO.UTF8 automatically. Otherwise you need to add them explicitly with - package arguments. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Ben George
-
Brandon S. Allbery KF8NH