GHC - 使用ncurses-0.2库编译项目时链接错误

时间:2011-03-05 20:38:25

标签: haskell linker-errors ncurses

我正在尝试使用来自hackage的ncurses-0.2库,但每当我尝试用cabal编译我的项目时。我收到链接器错误,安装+执行步骤

我使用的是Mac OS X Snow Leopard,并使用Haskell Platform 2010.02

您是否有任何见解或建议可以解决此问题?

$ brew install ncursesw --universal
Warning: It appears you have MacPorts or Fink installed.
Software installed with MacPorts and Fink are known to cause problems.
If you experience issues try uninstalling these tools.
==> Downloading http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz
File already downloaded and cached to /Users/roman/Library/Caches/Homebrew
==> ./configure --prefix=/Users/roman/.homebrew/Cellar/ncursesw/5.7 --mandir=/Users/roman/.homebrew/Cellar/ncursesw/5.7/share/man --disable-debug --disable-dependency-tracking --e
==> make install
/Users/roman/.homebrew/Cellar/ncursesw/5.7: 2734 files, 14M, in 93 seconds

$ cabal install ncurses --extra-include-dirs=/Users/roman/.homebrew/include --extra-lib-dirs=/Users/roman/.homebrew/lib --reinstall
Resolving dependencies...
Configuring ncurses-0.2...
Preprocessing library ncurses-0.2...
Building ncurses-0.2...
[1 of 4] Compiling UI.NCurses.Enums ( dist/build/UI/NCurses/Enums.hs, dist/build/UI/NCurses/Enums.o )
[2 of 4] Compiling UI.NCurses.Types ( UI/NCurses/Types.hs, dist/build/UI/NCurses/Types.o )
[3 of 4] Compiling UI.NCurses       ( dist/build/UI/NCurses.hs, dist/build/UI/NCurses.o )
[4 of 4] Compiling UI.NCurses.Panel ( dist/build/UI/NCurses/Panel.hs, dist/build/UI/NCurses/Panel.o )

UI/NCurses/Panel.chs:49:0:
    Warning: The import of `UI.NCurses' is redundant
               except perhaps to import instances from `UI.NCurses'
             To import instances alone, use: import UI.NCurses()
Registering ncurses-0.2...
Installing library in /Users/roman/.cabal/lib/ncurses-0.2/ghc-6.12.3
Registering ncurses-0.2...

$ cabal build
Preprocessing executables for TicTacToe-0.1...
Building TicTacToe-0.1...
Linking dist/build/TicTacToe/TicTacToe ...
ld: warning: in /Users/roman/.homebrew/lib/libncursesw.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols:
  "_start_color", referenced from:
      _s9ZP_info in libHSncurses-0.2.a(NCurses.o)
  "_wget_wch", referenced from:
      _sfkI_info in libHSncurses-0.2.a(NCurses.o)
  "_wenclose", referenced from:
      _s9Fs_info in libHSncurses-0.2.a(NCurses.o)
  "_beep", referenced from:
      _ncurseszm0zi2_UIziNCurses_beep1_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _ncurseszm0zi2_UIziNCurses_beep2_closure, _ncurseszm0zi2_UIziNCurses_beep1_srt , _ncurseszm0zi2_UIziNCurses_beep_srt , _ncurseszm0zi2_UIziNCurses_beep3_info , _ncurseszm0zi2_UIziNCurses_beep2_srt , _ncurseszm0zi2_UIziNCurses_beep3_srt , _ncurseszm0zi2_UIziNCurses_beep1_closure , _ncurseszm0zi2_UIziNCurses_beep_info , _ncurseszm0zi2_UIziNCurses_beep1_info , _ncurseszm0zi2_UIziNCurses_beep3_closure , _ncurseszm0zi2_UIziNCurses_beep2_info , _ncurseszm0zi2_UIziNCurses_beep_closure )
  "_echo", referenced from:
      _sc50_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: ___hscore_echo)
  "_can_change_color", referenced from:
      _ncurseszm0zi2_UIziNCurses_canDefineColor1_info in libHSncurses-0.2.a(NCurses.o)
  "_init_color", referenced from:
      _s97K_info in libHSncurses-0.2.a(NCurses.o)
      _scw2_info in libHSncurses-0.2.a(NCurses.o)
  "_wnoutrefresh", referenced from:
      _s2JC_info in NCurses.o
      _scSh_info in libHSncurses-0.2.a(NCurses.o)
  "_noraw", referenced from:
      _scaE_info in libHSncurses-0.2.a(NCurses.o)
  "_wtouchln", referenced from:
      _sd53_info in libHSncurses-0.2.a(NCurses.o)
      _sd53_info in libHSncurses-0.2.a(NCurses.o)
  "_wcolor_set", referenced from:
      _sav6_info in libHSncurses-0.2.a(NCurses.o)
  "_meta", referenced from:
      _s9KC_info in libHSncurses-0.2.a(NCurses.o)
      _scV2_info in libHSncurses-0.2.a(NCurses.o)
  "_initscr", referenced from:
      _ncurseszm0zi2_UIziNCurses_runCurses2_info in libHSncurses-0.2.a(NCurses.o)
  "_stdscr", referenced from:
      _stdscr$non_lazy_ptr in NCurses.o
      _stdscr$non_lazy_ptr in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _stdscr$non_lazy_ptr)
  "_wbkgrndset", referenced from:
      _scOA_info in libHSncurses-0.2.a(NCurses.o)
  "_raw", referenced from:
      _scaE_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _ffi_closure_raw_SYSV$non_lazy_ptr, _ffi_closure_raw_SYSV , _ffi_raw_call , _ffi_prep_raw_closure_loc )
  "__nc_has_mouse", referenced from:
      _hsncurses_has_mouse in libHSncurses-0.2.a(hsncurses-shim.o)
  "_wtimeout", referenced from:
      _s9KE_info in libHSncurses-0.2.a(NCurses.o)
      _scV4_info in libHSncurses-0.2.a(NCurses.o)
      _sfkG_info in libHSncurses-0.2.a(NCurses.o)
  "_doupdate", referenced from:
      _ncurseszm0zi2_UIziNCurses_render1_info in libHSncurses-0.2.a(NCurses.o)
  "_baudrate", referenced from:
      _ncurseszm0zi2_UIziNCurses_baudrate1_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _ncurseszm0zi2_UIziNCurses_baudrate1_info, _ncurseszm0zi2_UIziNCurses_baudrate_info , _ncurseszm0zi2_UIziNCurses_baudrate3_closure , _ncurseszm0zi2_UIziNCurses_baudrate_closure , _ncurseszm0zi2_UIziNCurses_baudrate_srt , _ncurseszm0zi2_UIziNCurses_baudrate2_info , _ncurseszm0zi2_UIziNCurses_baudrate2_closure , _ncurseszm0zi2_UIziNCurses_baudrate1_closure , _ncurseszm0zi2_UIziNCurses_baudrate3_info , _ncurseszm0zi2_UIziNCurses_baudrate1_srt , _ncurseszm0zi2_UIziNCurses_baudrate2_srt , _ncurseszm0zi2_UIziNCurses_baudrate3_srt )
  "_whline_set", referenced from:
      _s9gs_info in libHSncurses-0.2.a(NCurses.o)
  "_wvline_set", referenced from:
      _s9fL_info in libHSncurses-0.2.a(NCurses.o)
  "_cbreak", referenced from:
      _s9ZJ_info in libHSncurses-0.2.a(NCurses.o)
      _sc7P_info in libHSncurses-0.2.a(NCurses.o)
  "_endwin", referenced from:
      _ncurseszm0zi2_UIziNCurses_endwin_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _ncurseszm0zi2_UIziNCurses_endwin_info, _ncurseszm0zi2_UIziNCurses_endwin_closure )
  "_wattr_on", referenced from:
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
      _saal_info in libHSncurses-0.2.a(NCurses.o)
  "_newwin", referenced from:
      _s9du_info in libHSncurses-0.2.a(NCurses.o)
  "_getmouse", referenced from:
      _sfkP_info in libHSncurses-0.2.a(NCurses.o)
  "_touchwin", referenced from:
      _sa69_info in libHSncurses-0.2.a(NCurses.o)
  "_untouchwin", referenced from:
      _sa6c_info in libHSncurses-0.2.a(NCurses.o)
  "_has_colors", referenced from:
      _ncurseszm0zi2_UIziNCurses_supportsColor1_info in libHSncurses-0.2.a(NCurses.o)
      _s9ZN_info in libHSncurses-0.2.a(NCurses.o)
  "_mousemask", referenced from:
      _s9ZL_info in libHSncurses-0.2.a(NCurses.o)
  "_use_default_colors", referenced from:
      _s9ZS_info in libHSncurses-0.2.a(NCurses.o)
  "_waddwstr", referenced from:
      _sduP_info in libHSncurses-0.2.a(NCurses.o)
  "_wmove", referenced from:
      _sdBo_info in libHSncurses-0.2.a(NCurses.o)
  "_dupwin", referenced from:
      _scTH_info in libHSncurses-0.2.a(NCurses.o)
  "_keypad", referenced from:
      _ncurseszm0zi2_UIziNCurses_zdwa3_info in libHSncurses-0.2.a(NCurses.o)
      _say8_info in libHSncurses-0.2.a(NCurses.o)
      _say8_info in libHSncurses-0.2.a(NCurses.o)
      _scV0_info in libHSncurses-0.2.a(NCurses.o)
  "_noecho", referenced from:
      _sc50_info in libHSncurses-0.2.a(NCurses.o)
  "_flash", referenced from:
      _ncurseszm0zi2_UIziNCurses_flash1_info in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _ncurseszm0zi2_UIziNCurses_flash1_closure, _ncurseszm0zi2_UIziNCurses_flash_info , _ncurseszm0zi2_UIziNCurses_flash_srt , _ncurseszm0zi2_UIziNCurses_flash_closure , _ncurseszm0zi2_UIziNCurses_flash1_info , _ncurseszm0zi2_UIziNCurses_flash2_info , _ncurseszm0zi2_UIziNCurses_flash3_closure , _ncurseszm0zi2_UIziNCurses_flash1_srt , _ncurseszm0zi2_UIziNCurses_flash2_srt , _ncurseszm0zi2_UIziNCurses_flash2_closure , _ncurseszm0zi2_UIziNCurses_flash3_info , _ncurseszm0zi2_UIziNCurses_flash3_srt )
  "_wborder_set", referenced from:
      _scFt_info in libHSncurses-0.2.a(NCurses.o)
  "_COLS", referenced from:
      _COLS$non_lazy_ptr in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _COLS$non_lazy_ptr)
  "_init_pair", referenced from:
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _saTg_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
      _scdx_info in libHSncurses-0.2.a(NCurses.o)
  "_nocbreak", referenced from:
      _sc7P_info in libHSncurses-0.2.a(NCurses.o)
  "_delwin", referenced from:
      _sb4T_info in libHSncurses-0.2.a(NCurses.o)
  "_getcurx", referenced from:
      _s9Iy_info in libHSncurses-0.2.a(NCurses.o)
  "_getcury", referenced from:
      _s9Ix_info in libHSncurses-0.2.a(NCurses.o)
  "_color_content", referenced from:
      _sff4_info in libHSncurses-0.2.a(NCurses.o)
  "_COLOR_PAIRS", referenced from:
      _COLOR_PAIRS$non_lazy_ptr in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _COLOR_PAIRS$non_lazy_ptr)
  "_wattr_get", referenced from:
      _s9vO_info in libHSncurses-0.2.a(NCurses.o)
  "_wattr_off", referenced from:
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
      _saaF_info in libHSncurses-0.2.a(NCurses.o)
  "_wattr_set", referenced from:
      _s9vS_info in libHSncurses-0.2.a(NCurses.o)
  "_LINES", referenced from:
      _LINES$non_lazy_ptr in libHSncurses-0.2.a(NCurses.o)
     (maybe you meant: _LINES$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status

1 个答案:

答案 0 :(得分:2)