Cryptopp外部库依赖
cryptopp foreign library dependency
我尝试在Arch Linux(3.12.9)上通过cabal安装happstack-server-tls
包,但得到这个错误:
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++
。但它没有帮助我。
我甚至试过这个:
$ 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文件一起工作:
#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
测试。cpp编译良好。
然后我试着
$ cd /usr/lib
$ g++ -fpic -nostartfiles -nostdlib -shared libcryptopp.so -o libcryptopp.dylib
但是,还是没有运气。
有人遇到过这个问题吗?有解决方案吗?
运行cabal unpack happstack-server-tls
在本地目录中获取并解包源代码。然后编辑happstack-server-tls.cabal
并尝试删除这些行:
if !os(darwin)
Extra-Libraries: cryptopp
相关文章:
- 使用 Git 处理 C++ Visual Studio 2019 解决方案的外部依赖项源代码管理的最佳方法是什么?
- 如何将外部依赖引入跨平台CMake项目?
- 当 lib 已添加到其他依赖项时,如何在 VS 中调试未解析的外部符号错误
- 使用 cmake 获取外部依赖关系
- CMake 外部和内部静态库的循环依赖关系
- 如何在bazel中同时处理外部依赖项和我的项目
- 如果 copts 不允许系统路径,如何引用外部依赖项使用的系统库?
- 使用外部依赖项运行 VC++ 单元测试时"Failed to set up execution context"
- 无法构建外部库依赖项
- 如何忽略来自 Bazel 中的外部C++依赖项标头的警告
- CMake 和外部依赖关系
- 使用 CMake 外部项目为跨平台库依赖项的目标名称
- 是否可以编译具有在编译时无法解析的外部依赖项的静态库?
- C++项目文件夹外部依赖项仅包含 .h 和 .hpp 文件
- 如何避免#crude依赖外部库
- 在Visual Studios 2010的外部依赖项文件夹中搜索文本/代码
- visualstudioc++的外部依赖关系
- 如何在VS2015中将外部库依赖项链接到一个静态库文件中
- 如何测试从依赖于外部系统的外部基类派生的类
- 在命名空间前缀解析和优化级别依赖关系中使用外部"C" C++