简体   繁体   English

cpabe 0.11:添加符号时出错:命令行中缺少 DSO

[英]cpabe 0.11 : error adding symbols: DSO missing from command line

The cpabe library, implemented in C, has two components, the cpabe main source and libbswabe library which acts as a dependency.在 C 中实现的 cpabe 库有两个组件,即 cpabe 主源和作为依赖项的 libbswabe 库。 Both of which can be found here两者都可以在这里找到

The libbswabe library installed well enough, however, while making the cpabe source.然而,在制作 cpabe 源时,libbswabe 库安装得很好。 the following occured发生以下情况

gcc -o cpabe-setup setup.o common.o -O3 -Wall -lglib-2.0 -Wl,-rpath /usr/local/lib -lgmp -Wl,-rpath /usr/local/lib -lpbc -lbswabe -lcrypto -lcrypto 
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/libpbc.so: undefined reference to symbol '__gmpz_clear'
/usr/bin/ld: /lib/libgmp.so.3: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:34: cpabe-setup] Error 1

My system is an Ubuntu 20.04 LTS, and I have PBC and all the neccessary dependencies installed.我的系统是 Ubuntu 20.04 LTS,我安装了 PBC 和所有必要的依赖项。 However, I am quite new to this configure , make , sudo make install thing.但是,我对这个configuremakesudo make install东西很陌生。 So I need to know what I did wrong.所以我需要知道我做错了什么。

You putted -lpbc after -lgmp.你把 -lpbc 放在 -lgmp 之后。 The order is important, put -lgmp after -lpbc.顺序很重要,将 -lgmp 放在 -lpbc 之后。

If you have library a that depends on library b then the order must be -la -lb.如果您有依赖于库 b 的库 a,那么命令必须是 -la -lb。

You can use some of these two repositories:您可以使用这两个存储库中的一些:

https://github.com/GD14/cpabe https://github.com/GD14/cpabe

https://github.com/rkuma013/Bethencourt_CPABE https://github.com/rkuma013/Bethencourt_CPABE

They have a better updated code than cpabe-0.11...他们有比 cpabe-0.11 更好的更新代码......

And you can edit to Makefile after./configure execution and change order lines about -lgmp and -lpbc (how to Harkaitz showed), where: From: -Wl,-rpath /usr/local/lib -lgmp您可以在 ./configure 执行后编辑到 Makefile 并更改有关 -lgmp 和 -lpbc 的命令行(如何显示 Harkaitz),其中:来自:-Wl,-rpath /usr/local/lib -lgmp
-Wl,-rpath /usr/local/lib -lpbc \ -Wl,-rpath /usr/local/lib -lpbc \

->To this order: ->为了这个订单:

    -Wl,-rpath /usr/local/lib -lpbc \
    -Wl,-rpath /usr/local/lib -lgmp \

The make and make install commands will work OK. make 和 make install 命令可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM