2014-03-12 39 views
2

我試圖通過小集團上的Arch Linux(3.12.9)安裝包,但得到這個錯誤:cryptopp國外庫的依賴

Resolving dependencies... 
Configuring happstack-server-tls-7.1.0... 
Failed to install happstack-server-tls-7.1.0 
Last 10 lines of the build log (/home/boris/.cabal/logs/happstack-server-tls-7.1.0.log): 
Configuring happstack-server-tls-7.1.0... 
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) 
setup-Cabal-1.16.0-x86_64-linux-ghc-7.6.3: Missing dependency on a foreign 
library: 
* Missing C library: cryptopp 
This problem can usually be solved by installing the system package that 
provides this library (you may need the "-dev" version). If the library is 
already installed but in a non-standard location then you can use the flags 
--extra-include-dirs= and --extra-lib-dirs= to specify where it is. 
cabal: Error: some packages failed to install: 
happstack-server-tls-7.1.0 failed during the configure step. The exception 
was: 
ExitFailure 1 

看到此錯誤消息後的第一次,我已經安裝了crypto++通過pacman。但它沒有幫助我。

我甚至試過這樣:

$ whereis libcryptopp.a                       
libcryptopp: /usr/lib/libcryptopp.so 
$ cabal install happstack-server-tls --extra-include-dirs=/usr/lib/ --extra-lib-dirs=/usr/lib/ 

但仍沒有運氣。

我檢查,如果加密++的lib works。這TEST.CPP文件:

#include <iostream> 
using std::cout; 
using std::endl; 

#include "cryptopp/integer.h" 
using CryptoPP::Integer; 

int main(int, char**) { 

    Integer i; 

    cout << "i: " << i << endl; 

    return 0; 
} 

而且隨着g++ -g3 -ggdb -O0 -Wall -Wextra -Wno-unused -o test test.cpp -lcryptopp -pthread TEST.CPP編譯好。

然後我試圖

$ cd /usr/lib 
$ g++ -fpic -nostartfiles -nostdlib -shared libcryptopp.so -o libcryptopp.dylib 

但同樣,仍然沒有運氣。

有人遇到過這個問題嗎?有沒有解決方案?

回答

2

運行cabal unpack happstack-server-tls來獲取本地目錄中的源代碼並將其解壓縮。然後編輯happstack-server-tls.cabal並嘗試刪除這些行:

if !os(darwin) 
    Extra-Libraries: cryptopp 
+0

非常感謝。它幫助了我。但爲什麼發生? – d12frosted

+0

我不太確定。涉及鏈接和模板haskell和錯誤消息,我認爲有什麼複雜? – stepcut