Linux运行PBC库中bls程序Make时报错

错误提示:
make all
Building target: BLSExample
Invoking: GCC C Linker
gcc -L/usr/local/lib -o "BLSExample" ./bls.o -lpbc
/usr/bin/ld: ./bls.o: undefined reference to symbol '__gmpz_init'
//usr/local/lib/libgmp.so.10: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [BLSExample] Error 1
makefile:29: recipe for target 'BLSExample' failed

新手,希望可以知道详细解决方法 要详细!!!

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
想请教一下如何利用pbc库实现属性加密

由于学习需要,欲利用pbc库实现属性加密。以我目前对pbc库函数的了解,目前只能实现基于身份加密。属性加密中需要 **属性集** , **访问结构** 。 **我想知道如何将属性集和访问结构传给相关函数** 希望能有相关源码供参考,谢谢

C语言PBC库中的动态数组问题

我在用PBC库进行椭圆曲线上的属性签名仿真时遇到如下问题: ``` printf("请输入总的属性个数:\n"); scanf("%d",&n); for(i=1;i<=n;i++) { element_random(ti);//随机生成元素变量ti darray_append(Lt,ti);//向动态数组Lt中追加元素变量ti element_printf("t%d=%B\n",i,ti);//单独打印输出 } darray_show(Lt);//再次打印数组 ``` 动态数组已经定义并初始化了,但显示结果却是这样: ![追加图片说明](https://img-ask.csdn.net/upload/201804/25/1524643100_394481.png) 通过darray_show()函数打印的值是完全一样的16进制数!我想知道是darray_show()函数的问题,还是函数darray_append()的问题或者其它。两个函数的源程序如下: ``` void darray_show(darray_ptr a) { int i; for (i=0;i<a->count;i++) { printf("%d:%p\n",i,a->item[i]); } } ``` ``` void darray_append(darray_t a, void *p) { if (a->count == a->max) { if (!a->max) a->max = max_init; else a->max *= 2; a->item = pbc_realloc(a->item, sizeof(void *) * a->max); } a->item[a->count] = p; a->count++; } ``` 我试着把函数darray_show()中的字符格式%p改为%B后显示如下: ![图片说明](https://img-ask.csdn.net/upload/201804/25/1524647639_542719.png)此时0,1,2后面显示了不同的值, 在此恳请大佬们指点一下,谢谢!

VS2015如何实现PBC库编译,求解决方法

本人根据CSDN吧友提供的资料,将相应库文件.a文件都加载进去了,还是不行,使用的是VS2015,求解决方法![图片说明](https://img-ask.csdn.net/upload/201612/15/1481768873_819345.jpg)

求调用PBC库的时候错误显示出现了无法解析的外部符号?

在网上查资料,显示在属性连接里面添加lib但不知道缺哪个lib,望大牛解答一下![图片说明](https://img-ask.csdn.net/upload/201708/28/1503909733_177710.png)

在调用PBC库时,libgcc.a打不开怎么办

![图片说明](https://img-ask.csdn.net/upload/201704/26/1493203817_823339.png)源码如下#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; #include<pbc.h> #include<pbc_test.h> pairing_t pairing; element_t g; element_t u,h,v,w; element_t g1,g2,g3,g4; element_t d1,d2,d3,d4,alpha; element_t Z; element_t temp; element_t pars,msk; element_t K; void H(element_t ans, char *s) { element_from_hash(ans, s, strlen(s)); } void Setup(int argc, char **argv,int attr_num) { pbc_demo_pairing_init(pairing, argc, argv); element_init_G1(u,pairing); element_init_G1(h,pairing); element_init_G1(v,pairing); element_init_G1(w,pairing); element_init_G1(g,pairing); element_random(u); element_random(h); element_random(v); element_random(w); element_random(g); element_init_Zr(d1,pairing); element_init_Zr(d2,pairing); element_init_Zr(d3,pairing); element_init_Zr(d4,pairing); element_init_Zr(alpha,pairing); element_random(d1); element_random(d2); element_random(d3); element_random(d4); element_random(alpha); element_init_G1(g1,pairing); element_init_G1(g2,pairing); element_init_G1(g3,pairing); element_init_G1(g4,pairing); element_pow_zn(g1,g,d1);//g1=g^d1 element_pow_zn(g2,g,d2);//g2=g^d2 element_pow_zn(g3,g,d3);//g3=g^d3 element_pow_zn(g4,g,d4);//g4=g^d4 element_init_GT(Z,pairing); element_init_G1(temp,pairing); element_pow_zn(temp,g,alpha);//temp=g^alpha element_pairing(Z,temp,g);//Z=e(g,g)^alpha } void OutputSetup(int attr_num) { cout<<"Setup information:\n"; element_printf("%B\n",H); element_printf("pars: %B\n",g); element_printf(" %B\n",u); element_printf(" %B\n",h); element_printf(" %B\n",w); element_printf(" %B\n",v); element_printf(" %B\n",g1); element_printf(" %B\n",g2); element_printf(" %B\n",g3); element_printf(" %B\n",g4); element_printf(" %B\n",Z); cout<<endl; element_printf(" %B\n",g1); element_printf(" %B\n",g2); element_printf(" %B\n",g3); element_printf(" %B\n",g4); element_printf(" %B\n",temp); cout<<endl; } void KenGen() { /*element_t* A; element_t k; A=new element_t[k];*/ } int main(int argc, char **argv) { int attr_num = 3; cout<<"Input the number of attributes:\n"; cin>>attr_num; Setup(argc, argv, attr_num); OutputSetup(attr_num); return 0; } 请问大神是编写问题还是其他问题?

找不到gmp库

<div class="post-text" itemprop="text"> <p>I try to install pbc library which have gmp as dependence. Dockerfile:</p> <pre><code>FROM golang:1.9.6-alpine3.7 RUN mkdir -p /go/src/app WORKDIR /go/src/app COPY . /go/src/app RUN apk add --update git gcc build-base flex bison gmp RUN wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz &amp;&amp; \ tar -xvf pbc-0.5.14.tar.gz &amp;&amp; \ cd pbc-0.5.14 &amp;&amp; \ ./configure --prefix=$HOME/.local &amp;&amp; \ make &amp;&amp; make install RUN rm pbc-0.5.14.tar.gz &amp;&amp; rm -rf pbc-0.5.14 RUN go-wrapper download RUN go-wrapper install CMD ["go-wrapper", "run", "-web"] EXPOSE 8000 </code></pre> <p>However when I run it I get such an error during pbc installation:</p> <pre><code>gmp library not found add its path to LDFLAGS see ./configure --help </code></pre> <p>Here I found that i should add export: <a href="https://stackoverflow.com/questions/6254245/how-to-add-a-path-to-ldflags/12718015">How to add a path to LDFLAGS</a></p> <p>Note that I add gmp to dependencies, but pbg dont see it</p> <p>How should I do it throw docker?</p> </div>

用msys编译GMP、PBC库是出现错误,求万能的大神帮忙解决!

用msys编译GMP、PBC库是出现如下错误,求万能的大神帮忙解决! ![图片说明](https://img-ask.csdn.net/upload/201512/14/1450093275_306813.jpg) ![图片说明](https://img-ask.csdn.net/upload/201512/15/1450154311_902355.jpg) Config.log如下: This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU MP configure 6.1.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ ./configure CPPGLAGS=-D_USE_MINGW_ANSI_STDIO=0--enable-static --disable-shared --------- Platform. ## --------- hostname = Mr-Chen uname -m = i686 uname -r = 1.0.17(0.48/3/2) uname -s = MINGW32_NT-6.1 uname -v = 2011-04-24 23:39 /usr/bin/ uname -p = unknown /bin/ uname -X = unknown /bin/arch = unknown /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: . PATH: /usr/local/bin PATH: /mingw/bin PATH: /bin PATH: /d/ActivePerl/site/bin PATH: /d/ActivePerl/bin PATH: /c/Program Files (x86)/NVIDIA Corporation/PhysX/Common PATH: /c/Windows/system32 PATH: /c/Windows PATH: /c/Windows/System32/Wbem PATH: /c/Windows/System32/WindowsPowerShell/v1.0/ PATH: %QUARTUS_ROOTDIR%/bin PATH: /c/Program Files (x86)/Common Files/Ulead Systems/MPEG PATH: /c/Program Files (x86)/Microsoft SQL Server/80/Tools/Binn/ PATH: /d/Latex/CTEX/UserData/miktex/bin PATH: /d/Latex/CTEX/MiKTeX/miktex/bin PATH: /d/Latex/CTEX/CTeX/ctex/bin PATH: /d/Latex/CTEX/CTeX/cct/bin PATH: /d/Latex/CTEX/CTeX/ty/bin PATH: /d/Latex/CTEX/Ghostscript/gs9.05/bin PATH: /d/Latex/CTEX/GSview/gsview PATH: /d/Latex/CTEX/WinEdt PATH: /c/Program Files/Microsoft SQL Server/110/Tools/Binn/ PATH: /c/MinGW/bin/ PATH: /d/ActivePerl/site/bin/ PATH: /d/ActivePerl/bin/ PATH: /c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn/ PATH: /c/Program Files/Microsoft SQL Server/100/Tools/Binn/ PATH: /c/Program Files/Microsoft SQL Server/100/DTS/Binn/ PATH: /d/VS2010/VC/bin/ PATH: /d/MinGw/bin ----------- Core tests. ----------- configure:3055: checking build system type configure:3069: result: sandybridge-pc-mingw32 configure:3089: checking host system type configure:3102: result: sandybridge-pc-mingw32 configure:3139: checking for a BSD-compatible install configure:3207: result: /bin/install -c configure:3218: checking whether build environment is sane configure:3273: result: yes configure:3424: checking for a thread-safe mkdir -p configure:3463: result: /bin/mkdir -p configure:3470: checking for gawk configure:3486: found /bin/gawk configure:3497: result: gawk configure:3508: checking whether make sets $(MAKE) configure:3530: result: yes configure:3559: checking whether make supports nested variables configure:3576: result: yes configure:3705: checking whether to enable maintainer-specific portions of Makefiles configure:3714: result: no User: ABI= CC= CFLAGS=(unset) CPPFLAGS=(unset) MPN_PATH= GMP: abilist=64 x32 32 cclist=gcc icc cc configure:5749: gcc 2>&1 | grep xlc >/dev/null configure:5752: $? = 1 configure:5806: checking compiler gcc -O2 -pedantic -fomit-frame-pointer -m64 Test compile: configure:5820: gcc -O2 -pedantic -fomit-frame-pointer -m64 conftest.c >&5 conftest.c:1:0: sorry, unimplemented: 64-bit mode not compiled in configure:5823: $? = 1 failed program was: int main () { return 0; } configure:6909: result: no configure:5727: cc -c conftest.c >&5 configure:5730: $? = 0 configure:5733: checking whether cc is gcc configure:5735: result: yes configure:5749: cc 2>&1 | grep xlc >/dev/null configure:5752: $? = 1 configure:5806: checking compiler cc -O2 -pedantic -fomit-frame-pointer -m64 Test compile: configure:5820: cc -O2 -pedantic -fomit-frame-pointer -m64 conftest.c >&5 conftest.c:1:0: sorry, unimplemented: 64-bit mode not compiled in configure:5823: $? = 1 failed program was: int main () { return 0; } configure:6909: result: no configure:5749: gcc 2>&1 | grep xlc >/dev/null configure:5752: $? = 1 configure:5806: checking compiler gcc -O2 -pedantic -fomit-frame-pointer -mx32 Test compile: configure:5820: gcc -O2 -pedantic -fomit-frame-pointer -mx32 conftest.c >&5 cc1.exe: error: unrecognized command line option '-mx32' configure:5823: $? = 1 failed program was: int main () { return 0; } configure:6909: result: no configure:5727: cc -c conftest.c >&5 configure:5730: $? = 0 configure:5733: checking whether cc is gcc configure:5735: result: yes configure:5749: cc 2>&1 | grep xlc >/dev/null configure:5752: $? = 1 configure:5806: checking compiler cc -O2 -pedantic -fomit-frame-pointer -mx32 Test compile: configure:5820: cc -O2 -pedantic -fomit-frame-pointer -mx32 conftest.c >&5 cc1.exe: error: unrecognized command line option '-mx32' configure:5823: $? = 1 failed program was: int main () { return 0; } configure:6909: result: no configure:5749: gcc 2>&1 | grep xlc >/dev/null configure:5752: $? = 1 configure:5806: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer Test compile: configure:5820: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:5823: $? = 0 configure:5828: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 5829: ./a.out: No such file or directory ./configure: line 5829: ./b.out: No such file or directory configure:5831: $? = 0 Test compile: function pointer return configure:5874: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:5877: $? = 0 configure:5882: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 5883: ./a.out: No such file or directory ./configure: line 5883: ./b.out: No such file or directory configure:5885: $? = 0 Test compile: cmov instruction configure:5930: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:5933: $? = 0 configure:5938: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 5939: ./a.out: No such file or directory ./configure: line 5939: ./b.out: No such file or directory configure:5941: $? = 0 Test compile: double -> ulong conversion configure:5987: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:5990: $? = 0 configure:5995: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 5996: ./a.out: No such file or directory ./configure: line 5996: ./b.out: No such file or directory configure:5998: $? = 0 Test compile: double negation configure:6042: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6045: $? = 0 configure:6050: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6051: ./a.out: No such file or directory ./configure: line 6051: ./b.out: No such file or directory configure:6053: $? = 0 Test compile: double -> float conversion configure:6098: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6101: $? = 0 configure:6106: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6107: ./a.out: No such file or directory ./configure: line 6107: ./b.out: No such file or directory configure:6109: $? = 0 Test compile: gnupro alpha ev6 char spilling configure:6183: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6186: $? = 0 configure:6191: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6192: ./a.out: No such file or directory ./configure: line 6192: ./b.out: No such file or directory configure:6194: $? = 0 Test compile: __builtin_alloca availability configure:6234: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a(main.o): In function main': C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference toWinMain@16' collect2: ld returned 1 exit status configure:6237: $? = 1 failed program was: int k; int foo () { __builtin_alloca (k); } Test compile: abs int -> double conversion configure:6358: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6361: $? = 0 configure:6366: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6367: ./a.out: No such file or directory ./configure: line 6367: ./b.out: No such file or directory configure:6369: $? = 0 Test compile: long long reliability test 1 configure:6423: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 conftest.c:6:23: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:6426: $? = 0 configure:6431: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6432: ./a.out: No such file or directory ./configure: line 6432: ./b.out: No such file or directory configure:6434: $? = 0 Test compile: long long reliability test 2 configure:6484: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 conftest.c: In function 'f': conftest.c:7:26: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:6487: $? = 0 configure:6492: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6493: ./a.out: No such file or directory ./configure: line 6493: ./b.out: No such file or directory configure:6495: $? = 0 Test compile: freebsd hacked gcc configure:6545: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6548: $? = 0 configure:6553: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6554: ./a.out: No such file or directory ./configure: line 6554: ./b.out: No such file or directory configure:6556: $? = 0 Test compile: mpn_lshift_com optimization configure:6644: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6647: $? = 0 configure:6652: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6653: ./a.out: No such file or directory ./configure: line 6653: ./b.out: No such file or directory configure:6655: $? = 0 Test compile: mpn_lshift_com optimization 2 configure:6752: gcc -m32 -O2 -pedantic -fomit-frame-pointer conftest.c >&5 configure:6755: $? = 0 configure:6760: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 6761: ./a.out: No such file or directory ./configure: line 6761: ./b.out: No such file or directory configure:6763: $? = 0 configure:6909: result: yes configure: testlist sizeof-long-4 configure:7084: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer has sizeof(long)==4 configure:7097: gcc -m32 -O2 -pedantic -fomit-frame-pointer -c conftest.c >&5 configure:7100: $? = 0 configure:7105: result: yes configure:7423: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge Test compile: configure:7437: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=sandybridge conftest.c >&5 conftest.c:1:0: error: bad value (sandybridge) for -mtune= switch configure:7440: $? = 1 failed program was: int main () { return 0; } configure:8526: result: no configure:7423: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 Test compile: configure:7437: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7440: $? = 0 configure:7445: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7446: ./a.out: No such file or directory ./configure: line 7446: ./b.out: No such file or directory configure:7448: $? = 0 Test compile: function pointer return configure:7491: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7494: $? = 0 configure:7499: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7500: ./a.out: No such file or directory ./configure: line 7500: ./b.out: No such file or directory configure:7502: $? = 0 Test compile: cmov instruction configure:7547: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7550: $? = 0 configure:7555: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7556: ./a.out: No such file or directory ./configure: line 7556: ./b.out: No such file or directory configure:7558: $? = 0 Test compile: double -> ulong conversion configure:7604: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7607: $? = 0 configure:7612: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7613: ./a.out: No such file or directory ./configure: line 7613: ./b.out: No such file or directory configure:7615: $? = 0 Test compile: double negation configure:7659: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7662: $? = 0 configure:7667: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7668: ./a.out: No such file or directory ./configure: line 7668: ./b.out: No such file or directory configure:7670: $? = 0 Test compile: double -> float conversion configure:7715: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7718: $? = 0 configure:7723: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7724: ./a.out: No such file or directory ./configure: line 7724: ./b.out: No such file or directory configure:7726: $? = 0 Test compile: gnupro alpha ev6 char spilling configure:7800: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7803: $? = 0 configure:7808: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7809: ./a.out: No such file or directory ./configure: line 7809: ./b.out: No such file or directory configure:7811: $? = 0 Test compile: __builtin_alloca availability configure:7851: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a(main.o): In function main': C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference toWinMain@16' collect2: ld returned 1 exit status configure:7854: $? = 1 failed program was: int k; int foo () { __builtin_alloca (k); } Test compile: abs int -> double conversion configure:7975: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:7978: $? = 0 configure:7983: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7984: ./a.out: No such file or directory ./configure: line 7984: ./b.out: No such file or directory configure:7986: $? = 0 Test compile: long long reliability test 1 configure:8040: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 conftest.c:6:23: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:8043: $? = 0 configure:8048: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8049: ./a.out: No such file or directory ./configure: line 8049: ./b.out: No such file or directory configure:8051: $? = 0 Test compile: long long reliability test 2 configure:8101: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 conftest.c: In function 'f': conftest.c:7:26: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:8104: $? = 0 configure:8109: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8110: ./a.out: No such file or directory ./configure: line 8110: ./b.out: No such file or directory configure:8112: $? = 0 Test compile: freebsd hacked gcc configure:8162: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:8165: $? = 0 configure:8170: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8171: ./a.out: No such file or directory ./configure: line 8171: ./b.out: No such file or directory configure:8173: $? = 0 Test compile: mpn_lshift_com optimization configure:8261: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:8264: $? = 0 configure:8269: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8270: ./a.out: No such file or directory ./configure: line 8270: ./b.out: No such file or directory configure:8272: $? = 0 Test compile: mpn_lshift_com optimization 2 configure:8369: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 conftest.c >&5 configure:8372: $? = 0 configure:8377: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8378: ./a.out: No such file or directory ./configure: line 8378: ./b.out: No such file or directory configure:8380: $? = 0 configure:8526: result: yes configure:7423: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=sandybridge Test compile: configure:7437: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=sandybridge conftest.c >&5 conftest.c:1:0: error: bad value (sandybridge) for -march= switch configure:7440: $? = 1 failed program was: int main () { return 0; } configure:8526: result: no configure:7423: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 Test compile: configure:7437: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7440: $? = 0 configure:7445: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7446: ./a.out: No such file or directory ./configure: line 7446: ./b.out: No such file or directory configure:7448: $? = 0 Test compile: function pointer return configure:7491: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7494: $? = 0 configure:7499: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7500: ./a.out: No such file or directory ./configure: line 7500: ./b.out: No such file or directory configure:7502: $? = 0 Test compile: cmov instruction configure:7547: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7550: $? = 0 configure:7555: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7556: ./a.out: No such file or directory ./configure: line 7556: ./b.out: No such file or directory configure:7558: $? = 0 Test compile: double -> ulong conversion configure:7604: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7607: $? = 0 configure:7612: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7613: ./a.out: No such file or directory ./configure: line 7613: ./b.out: No such file or directory configure:7615: $? = 0 Test compile: double negation configure:7659: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7662: $? = 0 configure:7667: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7668: ./a.out: No such file or directory ./configure: line 7668: ./b.out: No such file or directory configure:7670: $? = 0 Test compile: double -> float conversion configure:7715: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7718: $? = 0 configure:7723: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7724: ./a.out: No such file or directory ./configure: line 7724: ./b.out: No such file or directory configure:7726: $? = 0 Test compile: gnupro alpha ev6 char spilling configure:7800: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7803: $? = 0 configure:7808: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7809: ./a.out: No such file or directory ./configure: line 7809: ./b.out: No such file or directory configure:7811: $? = 0 Test compile: __builtin_alloca availability configure:7851: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a(main.o): In function main': C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference toWinMain@16' collect2: ld returned 1 exit status configure:7854: $? = 1 failed program was: int k; int foo () { __builtin_alloca (k); } Test compile: abs int -> double conversion configure:7975: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:7978: $? = 0 configure:7983: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 7984: ./a.out: No such file or directory ./configure: line 7984: ./b.out: No such file or directory configure:7986: $? = 0 Test compile: long long reliability test 1 configure:8040: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 conftest.c:6:23: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:8043: $? = 0 configure:8048: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8049: ./a.out: No such file or directory ./configure: line 8049: ./b.out: No such file or directory configure:8051: $? = 0 Test compile: long long reliability test 2 configure:8101: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 conftest.c: In function 'f': conftest.c:7:26: warning: ISO C90 does not support 'long long' [-Wlong-long] configure:8104: $? = 0 configure:8109: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8110: ./a.out: No such file or directory ./configure: line 8110: ./b.out: No such file or directory configure:8112: $? = 0 Test compile: freebsd hacked gcc configure:8162: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:8165: $? = 0 configure:8170: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8171: ./a.out: No such file or directory ./configure: line 8171: ./b.out: No such file or directory configure:8173: $? = 0 Test compile: mpn_lshift_com optimization configure:8261: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:8264: $? = 0 configure:8269: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8270: ./a.out: No such file or directory ./configure: line 8270: ./b.out: No such file or directory configure:8272: $? = 0 Test compile: mpn_lshift_com optimization 2 configure:8369: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 conftest.c >&5 configure:8372: $? = 0 configure:8377: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest ./configure: line 8378: ./a.out: No such file or directory ./configure: line 8378: ./b.out: No such file or directory configure:8380: $? = 0 configure:8526: result: yes configure:7423: checking compiler gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 -mno-cygwin Test compile: configure:7437: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 -mno-cygwin conftest.c >&5 cc1.exe: error: unrecognized command line option '-mno-cygwin' configure:7440: $? = 1 failed program was: int main () { return 0; } configure:8526: result: no configure:8679: checking for gcc configure:8706: result: gcc configure:8935: checking for C compiler version configure:8944: gcc --version >&5 gcc.exe (GCC) 4.6.2 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:8955: $? = 0 configure:8944: gcc -v >&5 Using built-in specs. COLLECT_GCC=c:\MinGW\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.6.2 (GCC) configure:8955: $? = 0 configure:8944: gcc -V >&5 gcc.exe: error: unrecognized option '-V' gcc.exe: fatal error: no input files compilation terminated. configure:8955: $? = 1 configure:8944: gcc -qversion >&5 gcc.exe: error: unrecognized option '-qversion' gcc.exe: fatal error: no input files compilation terminated. configure:8955: $? = 1 configure:8975: checking whether the C compiler works configure:8997: gcc -m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7 D:\gmp-6.1.0 conftest.c >&5 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find D:\gmp-6.1.0: Permission denied collect2: ld returned 1 exit status configure:9001: $? = 1 configure:9039: result: no configure: failed program was: | /* confdefs.h / | #define PACKAGE_NAME "GNU MP" | #define PACKAGE_TARNAME "gmp" | #define PACKAGE_VERSION "6.1.0" | #define PACKAGE_STRING "GNU MP 6.1.0" | #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html" | #define PACKAGE_URL "http://www.gnu.org/software/gmp/" | #define PACKAGE "gmp" | #define VERSION "6.1.0" | #define WANT_ASSEMBLY 1 | #define WANT_FFT 1 | #define HAVE_HOST_CPU_sandybridge 1 | #define HOST_DOS64 1 | #define HAVE_SPEED_CYCLECOUNTER 2 | #define HAVE_CALLING_CONVENTIONS 1 | / end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:9044: error: in /d/gmp-6.1.0': configure:9046: error: C compiler cannot create executables Seeconfig.log' for more details ---------------- Cache variables. ---------------- ac_cv_build=sandybridge-pc-mingw32 ac_cv_env_ABI_set= ac_cv_env_ABI_value= ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_FOR_BUILD_set= ac_cv_env_CC_FOR_BUILD_value= ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_FOR_BUILD_set= ac_cv_env_CPP_FOR_BUILD_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXCPP_set= ac_cv_env_CXXCPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set= ac_cv_env_CXX_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value='D:\gmp-6.1.0' ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_LT_SYS_LIBRARY_PATH_set= ac_cv_env_LT_SYS_LIBRARY_PATH_value= ac_cv_env_M4_set= ac_cv_env_M4_value= ac_cv_env_YACC_set= ac_cv_env_YACC_value= ac_cv_env_YFLAGS_set= ac_cv_env_YFLAGS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=sandybridge-pc-mingw32 ac_cv_path_install='/bin/install -c' ac_cv_path_mkdir=/bin/mkdir ac_cv_prog_AWK=gawk ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_make_make_set=yes am_cv_make_support_nested_variables=yes ----------------- Output variables. ----------------- ABI='32' ACLOCAL='${SHELL} /d/gmp-6.1.0/missing aclocal-1.15' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' AM_DEFAULT_VERBOSITY='1' AM_V='$(V)' AR='' AS='' ASMFLAGS='' AUTOCONF='${SHELL} /d/gmp-6.1.0/missing autoconf' AUTOHEADER='${SHELL} /d/gmp-6.1.0/missing autoheader' AUTOMAKE='${SHELL} /d/gmp-6.1.0/missing automake-1.15' AWK='gawk' CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo' CC='gcc' CCAS='' CC_FOR_BUILD='' CFLAGS='-m32 -O2 -pedantic -fomit-frame-pointer -mtune=corei7 -march=corei7' CPP='' CPPFLAGS='' CPP_FOR_BUILD='' CXX='' CXXCPP='' CXXFLAGS='' CYGPATH_W='echo' DEFN_LONG_LONG_LIMB='/* #undef LONG_LONG_LIMB */' DEFS='' DLLTOOL='' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' ENABLE_STATIC_FALSE='' ENABLE_STATIC_TRUE='' EXEEXT='' EXEEXT_FOR_BUILD='' FGREP='' GMP_LDFLAGS='' GMP_LIMB_BITS='' GMP_NAIL_BITS='0' GREP='' HAVE_CLOCK_01='' HAVE_CPUTIME_01='' HAVE_GETRUSAGE_01='' HAVE_GETTIMEOFDAY_01='' HAVE_HOST_CPU_FAMILY_power='0' HAVE_HOST_CPU_FAMILY_powerpc='0' HAVE_SIGACTION_01='' HAVE_SIGALTSTACK_01='' HAVE_SIGSTACK_01='' HAVE_STACK_T_01='' HAVE_SYS_RESOURCE_H_01='' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='' LDFLAGS='D:\gmp-6.1.0' LEX='' LEXLIB='' LEX_OUTPUT_ROOT='' LIBCURSES='' LIBGMPXX_LDFLAGS='' LIBGMP_DLL='' LIBGMP_LDFLAGS='' LIBM='' LIBM_FOR_BUILD='' LIBOBJS='' LIBREADLINE='' LIBS='' LIBTOOL='' LIPO='' LN_S='' LTLIBOBJS='' LT_SYS_LIBRARY_PATH='' M4='' MAINT='#' MAINTAINER_MODE_FALSE='' MAINTAINER_MODE_TRUE='#' MAKEINFO='${SHELL} /d/gmp-6.1.0/missing makeinfo' MANIFEST_TOOL='' MKDIR_P='/bin/mkdir -p' NM='' NMEDIT='' OBJDUMP='' OBJEXT='' OTOOL64='' OTOOL='' PACKAGE='gmp' PACKAGE_BUGREPORT='gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html' PACKAGE_NAME='GNU MP' PACKAGE_STRING='GNU MP 6.1.0' PACKAGE_TARNAME='gmp' PACKAGE_URL='http://www.gnu.org/software/gmp/' PACKAGE_VERSION='6.1.0' PATH_SEPARATOR=':' RANLIB='' SED='' SET_MAKE='' SHELL='/bin/sh' SPEED_CYCLECOUNTER_OBJ='pentium.lo' STRIP='' TAL_OBJECT='' TUNE_LIBS='' TUNE_SQR_OBJ='' U_FOR_BUILD='' VERSION='6.1.0' WANT_CXX_FALSE='' WANT_CXX_TRUE='' WITH_READLINE_01='' YACC='' YFLAGS='' ac_ct_AR='' ac_ct_CC='gcc' ac_ct_CXX='' ac_ct_DUMPBIN='' am_EXEEXT_FALSE='' am__EXEEXT_TRUE='' am__isrc='' am__leading_dot='.' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' bindir='${exec_prefix}/bin' build='sandybridge-pc-mingw32' build_alias='' build_cpu='sandybridge' build_os='mingw32' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' gmp_srclinks='' host='sandybridge-pc-mingw32' host_alias='' host_cpu='sandybridge' host_os='mingw32' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /d/gmp-6.1.0/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' mpn_objects='' mpn_objs_in_libgmp='' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='NONE' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ----------- confdefs.h. ----------- /* confdefs.h */ #define PACKAGE_NAME "GNU MP" #define PACKAGE_TARNAME "gmp" #define PACKAGE_VERSION "6.1.0" #define PACKAGE_STRING "GNU MP 6.1.0" #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html" #define PACKAGE_URL "http://www.gnu.org/software/gmp/" #define PACKAGE "gmp" #define VERSION "6.1.0" #define WANT_ASSEMBLY 1 #define WANT_FFT 1 #define HAVE_HOST_CPU_sandybridge 1 #define HOST_DOS64 1 #define HAVE_SPEED_CYCLECOUNTER 2 #define HAVE_CALLING_CONVENTIONS 1 configure: exit 77

PBC库函数里如何调用使用数组,是调用darray_t 这个函数吗

PBC库函数里如何调用使用数组,是调用darray_t 这个函数吗?望大神门解答一下,感激不尽

ubuntu系统中c编译问题

程序如下: ``` #include "/usr/local/include/pbc/pbc.h" #include "/usr/local/include/pbc/pbc_test.h" #include <stdio.h> #include<string.h> #include<time.h> int main(int argc, char **argv) { pairing_t pairing; pbc_demo_pairing_init(pairing, argc, argv); double th1, th2, th_1, th_2, ta1, ta2, tm1, tm2, tm_1, tm_2, tp1, tp2, te1, te2; element_t x, x2, h; element_t P, H, P1, P2; element_t Q; element_init_Zr(x, pairing); element_init_Zr(x2, pairing); element_init_Zr(h, pairing); element_init_G1(P, pairing); element_init_G1(P1, pairing); element_init_G1(P2, pairing); element_init_G1(H, pairing); element_init_GT(Q, pairing); //hash到数 th1 = pbc_get_time(); element_from_hash(h, "message", 7); th2 = pbc_get_time(); //hash到点 th_1 = pbc_get_time(); element_from_hash(P, "message", 7); th_2 = pbc_get_time(); element_random(x); element_random(x2); element_random(P); element_random(P1); element_random(P2); element_random(H); //点加 ta1 = pbc_get_time(); element_add(P, P, H); ta2 = pbc_get_time(); //数和点的乘法 tm1 = pbc_get_time(); element_mul_zn(P, P, x); tm2 = pbc_get_time(); //点和点的乘法 tm_1 = pbc_get_time(); element_mul_zn(P, P1, P2); tm_2 = pbc_get_time(); //对运算weil pairing tp1 = pbc_get_time(); pairing_apply(Q, P1, P1, pairing); tp2 = pbc_get_time(); //模幂运算modular expone te1 = pbc_get_time(); element_pow_zn(H, P2, x2); te2 = pbc_get_time(); printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\n", th2-th1, th_2-th_1, ta2-ta1, tm2-tm1, tm_2-tm_1, tp2-tp1, te2-te1); //FILE *fp; //fp=fopen("data.txt", "a"); //fclose(fp); element_clear(x); element_clear(P); element_clear(H); pairing_clear(pairing); return 0; } ``` 出现的问题如下: /tmp/ccFHLNvf.o:在函数‘element_mul_zn’中: main.c:(.text+0x110):对‘__gmpz_init’未定义的引用 main.c:(.text+0x146):对‘__gmpz_clear’未定义的引用 /tmp/ccFHLNvf.o:在函数‘element_pow_zn’中: main.c:(.text+0x1ae):对‘__gmpz_init’未定义的引用 main.c:(.text+0x1e4):对‘__gmpz_clear’未定义的引用 /tmp/ccFHLNvf.o:在函数‘pbc_demo_pairing_init’中: main.c:(.text+0x37c):对‘pbc_die’未定义的引用 main.c:(.text+0x3b4):对‘pbc_die’未定义的引用 main.c:(.text+0x3e0):对‘pairing_init_set_buf’未定义的引用 main.c:(.text+0x3f4):对‘pbc_die’未定义的引用 /tmp/ccFHLNvf.o:在函数‘main’中: main.c:(.text+0x51a):对‘pbc_get_time’未定义的引用 main.c:(.text+0x53e):对‘pbc_get_time’未定义的引用 main.c:(.text+0x549):对‘pbc_get_time’未定义的引用 main.c:(.text+0x56d):对‘pbc_get_time’未定义的引用 main.c:(.text+0x5e4):对‘pbc_get_time’未定义的引用 /tmp/ccFHLNvf.o:main.c:(.text+0x60f): 跟着更多未定义的参考到 pbc_get_time /tmp/ccFHLNvf.o:在函数‘main’中: main.c:(.text+0x7d1):对‘pairing_clear’未定义的引用 collect2: error: ld returned 1 exit status 本人纯新手,完全不懂这是出什么问题了。还请详细回答,谢谢了!

ubuntu中c的编译问题(有报错)

源代码如下: ``` #include "/usr/local/include/pbc/pbc.h" #include "/usr/local/include/pbc/pbc_test.h" #include <stdio.h> #include<string.h> #include<time.h> int main(int argc, char **argv) { pairing_t pairing; pbc_demo_pairing_init(pairing, argc, argv); double th1, th2, th_1, th_2, ta1, ta2, tm1, tm2, tm_1, tm_2, tp1, tp2, te1, te2; element_t x, x2, h; element_t P, H, P1, P2; element_t Q; element_init_Zr(x, pairing); element_init_Zr(x2, pairing); element_init_Zr(h, pairing); element_init_G1(P, pairing); element_init_G1(P1, pairing); element_init_G1(P2, pairing); element_init_G1(H, pairing); element_init_GT(Q, pairing); //hash到数 th1 = pbc_get_time(); element_from_hash(h, "message", 7); th2 = pbc_get_time(); //hash到点 th_1 = pbc_get_time(); element_from_hash(P, "message", 7); th_2 = pbc_get_time(); element_random(x); element_random(x2); element_random(P); element_random(P1); element_random(P2); element_random(H); //点加 ta1 = pbc_get_time(); element_add(P, P, H); ta2 = pbc_get_time(); //数和点的乘法 tm1 = pbc_get_time(); element_mul_zn(P, P, x); tm2 = pbc_get_time(); //点和点的乘法 tm_1 = pbc_get_time(); element_mul_zn(P, P1, P2); tm_2 = pbc_get_time(); //对运算weil pairing tp1 = pbc_get_time(); pairing_apply(Q, P1, P1, pairing); tp2 = pbc_get_time(); //模幂运算modular expone te1 = pbc_get_time(); element_pow_zn(H, P2, x2); te2 = pbc_get_time(); printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\n", th2-th1, th_2-th_1, ta2-ta1, tm2-tm1, tm_2-tm_1, tp2-tp1, te2-te1); //FILE *fp; //fp=fopen("data.txt", "a"); //fclose(fp); element_clear(x); element_clear(P); element_clear(H); pairing_clear(pairing); return 0; } ``` 先编译运行gcc -Wall -o main main.c -L. -lpbc -lgmp是没有问题的,接下来编译运行./main < /home/gaokai/下载/pbc-0.5.14/param/a.param的时候,便有了以下报错: ./main: error while loading shared libraries: libpbc.so.1: cannot open shared object file: No such file or directory 本人新手,对这一块懂得很少,还请大神详细给我说一下是哪里出了问题,该怎么解决。万分感谢!!!

在ubuntu使用gcc编译一个基本签名算法出现 段错误 核心已转储 麻烦给看看程序有什么错误。

可能程序存在不止一个错误,如果可以,麻烦一一指出 如果哪位高手能帮忙让程序跑出结果,我把剩下的140C送给他作为感谢! #include "pbc.h" int main(void) { pairing_t pairing; element_t g, h; element_t public_key, sig; element_t secret_key; element_t temp1, temp2; char *string1; pairing_init_set_str(pairing, string1); element_init_G2(g, pairing); element_init_G2(public_key, pairing); element_init_G1(h, pairing); element_init_G1(sig, pairing); element_init_GT(temp1, pairing); element_init_GT(temp2, pairing); element_init_Zr(secret_key, pairing); printf("Short signature test\n"); //generate system parameters element_random(g); element_printf("system parameter g = %B\n", g); //generate private key element_random(secret_key); element_printf("private key = %B\n", secret_key); //compute corresponding public key element_pow_zn(public_key, g, secret_key); element_printf("public key = %B\n", public_key); //generate element from a hash //for toy pairings, should check that pairing(g, h) != 1 element_from_hash(h, "hashofmessage", 13); element_printf("message hash = %B\n", h); //h^secret_key is the signature //in real life: only output the first coordinate element_pow_zn(sig, h, secret_key); element_printf("signature = %B\n", sig); { int n = pairing_length_in_bytes_compressed_G1(pairing); //int n = element_length_in_bytes_compressed(sig); int i; unsigned char *data = pbc_malloc(n); element_to_bytes_compressed(data, sig); printf("compressed = "); for (i = 0; i < n; i++) { printf("%02X", data[i]); } printf("\n"); element_from_bytes_compressed(sig, data); element_printf("decompressed = %B\n", sig); pbc_free(data); } //verification part 1 pairing_apply(temp1, sig, g, pairing); element_printf("f(sig, g) = %B\n", temp1); //verification part 2 //should match above pairing_apply(temp2, h, public_key, pairing); element_printf("f(message hash, public_key) = %B\n", temp2); if (!element_cmp(temp1, temp2)) { printf("signature verifies\n"); } else { printf("*BUG* signature does not verify *BUG*\n"); } { int n = pairing_length_in_bytes_x_only_G1(pairing); //int n = element_length_in_bytes_x_only(sig); int i; unsigned char *data = pbc_malloc(n); element_to_bytes_x_only(data, sig); printf("x-coord = "); for (i = 0; i < n; i++) { printf("%02X", data[i]); } printf("\n"); element_from_bytes_x_only(sig, data); element_printf("de-x-ed = %B\n", sig); pairing_apply(temp1, sig, g, pairing); if (!element_cmp(temp1, temp2)) { printf("signature verifies on first guess\n"); } else { element_invert(temp1, temp1); if (!element_cmp(temp1, temp2)) { printf("signature verifies on second guess\n"); } else { printf("*BUG* signature does not verify *BUG*\n"); } } pbc_free(data); } //a random signature shouldn't verify element_random(sig); pairing_apply(temp1, sig, g, pairing); if (element_cmp(temp1, temp2)) { printf("random signature doesn't verify\n"); } else { printf("*BUG* random signature verifies *BUG*\n"); } element_clear(sig); element_clear(public_key); element_clear(secret_key); element_clear(g); element_clear(h); element_clear(temp1); element_clear(temp2); pairing_clear(pairing); return 0; }

proto文件如何编译成tolua可以用的文件

proto文件如何编译成tolua可以用的文件 我从CSDN上看了很多教程 都是 编译的时候报错 from google.protobuf import reflection 不知道大佬们有没有类似的工具 或者教程 最好是 自己确认过了...我的心态有点炸了 谢谢大佬

C语言怎样定义一个动态数组

怎样定义一个动态数组,然后输入字符,输入字符的个数就是数组的长度?求代码或思路,蟹蟹

写并归排序时,提示“段错误 (核心已转储)”

参考的是[这个博客](http://www.cnblogs.com/rio2607/p/4489893.html),想自己实现一遍,结果不停的报错不知道为什么 ```c #include <iostream> #include <vector> void merge(std::vector<int> &nums, int start, int end, std::vector<int> &res); void mergeSort(std::vector<int> &nums, int start, int end, std::vector<int> &res) { if (end - start == 1) { if (nums[start] > nums[end]) { std::swap(nums[start], nums[end]); return; } } else if (end - start == 0) { return; } else { mergeSort(nums, start, start + (end - start + 1) / 2, res); mergeSort(nums, (end - start + 1) / 2 + start + 1, end, res); merge(nums, start, end, res); } }; void merge(std::vector<int> &nums, int start, int end, std::vector<int> &res) { int leftLen = (end - start + 1) / 2 + 1; int leftIdx = start; int rightIdx = start + leftLen; int resIdex = start; while (leftIdx < start + leftLen && rightIdx < end + 1) { if (nums[leftIdx] <= nums[rightIdx]) { //运行到这里报错,我尝试了下没有超过界限啊 std::cout << "11" << std::endl; res[resIdex++] = nums[leftIdx++]; } else { std::cout << "12" << std::endl; res[resIdex++] = nums[rightIdx++]; } } while (leftIdx < start + leftLen) { std::cout << "2" << std::endl; res[resIdex++] = nums[leftIdx++]; } while (rightIdx < end + 1) { std::cout << "3" << std::endl; res[resIdex++] = nums[rightIdx++]; } } int main(int argc, char const *argv[]) { std::vector<int> nums = {1, 5, 7, 3 ,8, 3, 5, 6, 8, 11}; int n = nums.size(); std::cout << "Original Nums is" << std::endl; for (auto num : nums) { std::cout << num << ","; } std::cout << std::endl; std::vector<int> res; mergeSort(nums, 0, n - 1, res); std::cout << "Sorted Nums is" << std::endl; for (auto num : res) { std::cout << num << ","; } std::cout << std::endl; return 0; } ``` 显示结果为: Original Nums is 1,5,7,3,8,3,5,6,8,11, 1 5 0,2,2,0,2,0, 1 11 段错误 (核心已转储)

C语言数组个数的定义a[]

#include<stdio.h> #include<stdlib.h> static long int a[1000000000]; int main() { } 这个代码,为什么a[]中0为9个就会报错,但是多余或者少于9个都不会报错? ``` ```

Ubuntu 无法ld stdio问题

试过了apt build-essentia 也试过了gcc -O2-Wall -o client client.c -lstdio命令 libc6-dev也是最新的,还是不行,求解救。。。问题如图![图片](https://img-ask.csdn.net/upload/201702/26/1488078692_551415.jpg)

orcal 存储过程 报错:success with compilation error

create or replace procedure test_count as id VARCHAR2(50); name VARCHAR2(50); credentialCode VARCHAR2(50); FK_ITEM_ID VARCHAR2(50); totalMoney VARCHAR2(50); totalBuyTime VARCHAR2(50); usedTime VARCHAR2(50); freeTime VARCHAR2(50); totalTime VARCHAR2(50); diffTime VARCHAR2(50); --IF_RIGHT VARCHAR2(50); begin SELECT --c.*,c.购买学时 - c.已花费 应该剩余 c.userid into id ,c.name into name, c.login_id into credentialCode ,c.fk_item_id into FK_ITEM_ID, c.购买学时 - c.已花费 into freeTime,c.已花费 into usedTime, c.购买学时 into totalBuyTime, c.different_time into diffTime,c.totalMoney into totalMoney FROM ( SELECT e.name, --s.login_id, T.login_id, T . SID AS userid, NVL (T .utime, 0) + NVL (TO_NUMBER(T .ptime), 0) - SUM (zb.class_time) AS different_time, SUM (zb.class_time) AS 购买学时, T .ptime AS 剩余, T .utime AS 已花费, zb.fk_item_id AS fk_item_id, t.totalMoney FROM ( SELECT su. ID AS SID, su .login_id as login_id, -- 加 SUM (pbc. TIME) AS utime, pt. TIME AS ptime, "SUM" (zii.study_price * pbc. TIME) as totalMoney FROM sso_user su LEFT JOIN training_course_student tc ON tc.student_id = su. ID -- 学习记录进度表 LEFT JOIN zgpx_class_opencourse zo ON tc.course_id = zo. ID -- 课程批次关联表 LEFT JOIN pe_bzz_tch_course pbc ON pbc. ID = zo.course_id -- 课程基本信息表 LEFT JOIN ZGPX_ITEM_INFO zii on pbc.CONFER_NAME = zii.id -- 资格表 LEFT JOIN ( SELECT ssu. ID AS ssuid, SUM (ptp. TIME) AS TIME FROM PE_TOTAL_PEROID ptp -- 学时账号余额表 LEFT JOIN SSO_USER ssu ON ssu.LOGIN_ID = ptp.CREDENTIAL_CODE AND ptp.FK_ITEM_ID = ssu.FK_ITEMINFO_ID GROUP BY ssu. ID ) pt ON pt.ssuid = su. ID WHERE tc.is_delete IS NULL AND ( pbc.confer_name = su.fk_iteminfo_id OR pbc. ID IS NULL ) GROUP BY su. ID, pt. TIME, su .login_id ) T LEFT JOIN zgpx_book_sso_order zb ON zb.fk_sso_user = T . SID, --sso_user s, -- pe_employee_info e WHERE (zb.fk_order_status = '20131012' or zb.fk_order_status = '2016052502') --and s.id =T . SID -- --and e.fk_sso_user_id=s.id and e.fk_sso_user_id=t.SID GROUP BY T . SID, --s.login_id, -- T.login_id, e.name, T .utime, T .ptime, fk_item_id, totalMoney ) C WHERE c.different_time != '0' -- c.different_time大于0 或小于0均为异常数据 ORDER BY c.different_time DESC; DBMS_OUTPUT.put_line('总人数:'||diffTime); end; ``` ```

android wifi-direct连接慢如何解决

小弟在开发android wifi-direct,当使用 WifiP2pConfig config = new WifiP2pConfig(); config.deviceAddress = device.deviceAddress; config.wps.setup = WpsInfo.PBC; mWifiP2pManger.connect(mChannel, config, new WifiP2pManager.ActionListener() {...} 来连接对端时,经常broadcatreceiver中十几秒以后才检测到连接上或者没有检测到连接上,这个问题如何解决?是我的连接代码有问题吗?

android wifi direct group owner negotiation

有人知道android wifi direct 中group owner negotiation 中的哪个device作为GO哪个作为Client以及 采用Pin码还是PBC模式是在哪里确定的吗?

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

立即提问
相关内容推荐