cryptopp外部库依赖 [英] cryptopp foreign library dependency
问题描述
我尝试通过Archal在Arch Linux(3.12.9)上安装 happstack-server-tls
包,但出现此错误:
I tried to install happstack-server-tls
package via cabal on Arch Linux (3.12.9), but got this error:
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
看到此错误消息第一次,我通过pacman安装了 crypto ++
。但它没有帮助我。
After seeing this error message for the first time, I have installed crypto++
via pacman. But it didn't help me.
我甚至尝试过:
$ whereis libcryptopp.a
libcryptopp: /usr/lib/libcryptopp.so
$ cabal install happstack-server-tls --extra-include-dirs=/usr/lib/ --extra-lib-dirs=/usr/lib/
但还是没有运气。
我检查了,如果crypto ++ lib使用这个test.cpp文件:
I checked, if crypto++ lib works with this test.cpp file:
#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编译好。
And with g++ -g3 -ggdb -O0 -Wall -Wextra -Wno-unused -o test test.cpp -lcryptopp -pthread
test.cpp compiled well.
然后我尝试
$ cd /usr/lib
$ g++ -fpic -nostartfiles -nostdlib -shared libcryptopp.so -o libcryptopp.dylib
但再次,仍然没有运气。
But again, still no luck.
有人遇到这个问题吗?有任何解决方案吗?
Have someone faced this problem? Has it any solutions?
推荐答案
执行 cabal unpack happstack-server-tls
源代码在本地目录中。然后编辑 happstack-server-tls.cabal
并尝试删除这些行:
run cabal unpack happstack-server-tls
to fetch and unpack the source code in a local directory. Then edit the happstack-server-tls.cabal
and try removing these lines:
if !os(darwin)
Extra-Libraries: cryptopp
这篇关于cryptopp外部库依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!