如何解析体系结构x86_64的未定义符号:_ZCMain_main_closure?

时间:2016-03-11 06:28:55

标签: macos haskell cabal

我在Mac OS X El Capitan 10.11.3上构建了一个haskell cabal应用程序。但是当我尝试使用

运行它时
ghc webrtc-vad.cabal

我收到错误

  

文件是为不支持的文件格式构建的(0x6E 0x61 0x6D 0x65 0x3A   0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20)哪个不是   被链接的体系结构(x86_64):webrtc-vad.cabal ...未定义   架构符号x86_64:" _ZCMain_main_closure"

makefile如下所示:

name:                webrtc-vad
version:             0.1.0.2
synopsis:            Easy voice activity detection
description:         A simple library wrapping WebRTC's voice activity detection engine.
license:             MIT
license-file:        LICENSE
author:              Patrick Chilton
maintainer:          chpatrick@gmail.com
-- copyright:           
category:            Sound
build-type:          Simple
-- extra-source-files:  
cabal-version:       >=1.10
extra-source-files:
  src/cbits/webrtc/*.h
  src/cbits/webrtc/common_audio/signal_processing/*.h
  src/cbits/webrtc/common_audio/signal_processing/include/*.h
  src/cbits/webrtc/common_audio/vad/*.h
  src/cbits/webrtc/common_audio/vad/include/*.h
  src/cbits/webrtc/system_wrappers/interface/*.h

source-repository head
  type:                git
  location:            https://github.com/chpatrick/haskell-webrtc-vad.git

library
  exposed-modules:     Sound.VAD.WebRTC
  -- other-modules:       
  other-extensions:    ForeignFunctionInterface
  build-depends:       base >=4.6 && <4.9, vector >= 0.11.0.0, primitive >= 0.6
  hs-source-dirs:      src
  build-tools:         hsc2hs
  default-language:    Haskell2010
  include-dirs:        src/cbits
  cc-options:          -DWEBRTC_POSIX -fPIC -m64
  ghc-options:         -Wall
  c-sources:
    src/cbits/webrtc/common_audio/signal_processing/downsample_fast.c
    src/cbits/webrtc/common_audio/signal_processing/min_max_operations.c
    src/cbits/webrtc/common_audio/signal_processing/cross_correlation.c
    src/cbits/webrtc/common_audio/signal_processing/vector_scaling_operations.c
    src/cbits/webrtc/common_audio/signal_processing/spl_init.c
    src/cbits/webrtc/common_audio/signal_processing/resample_48khz.c
    src/cbits/webrtc/common_audio/signal_processing/resample_by_2_internal.c
    src/cbits/webrtc/common_audio/signal_processing/resample_fractional.c
    src/cbits/webrtc/common_audio/signal_processing/division_operations.c
    src/cbits/webrtc/common_audio/signal_processing/energy.c
    src/cbits/webrtc/common_audio/signal_processing/complex_bit_reverse.c
    src/cbits/webrtc/common_audio/signal_processing/complex_fft.c
    src/cbits/webrtc/common_audio/signal_processing/get_scaling_square.c
    src/cbits/webrtc/common_audio/signal_processing/real_fft.c
    src/cbits/webrtc/common_audio/vad/webrtc_vad.c
    src/cbits/webrtc/common_audio/vad/vad_core.c
    src/cbits/webrtc/common_audio/vad/vad_gmm.c
    src/cbits/webrtc/common_audio/vad/vad_filterbank.c
    src/cbits/webrtc/common_audio/vad/vad_sp.c

如何为我的平台正确编译应用程序?

1 个答案:

答案 0 :(得分:1)

尝试改为运行cabal install webrtc-vad