ubuntu下编译srp-2.1.2

发布于 2024-08-29 05:58:45 字数 4879 浏览 6 评论 0原文

我已经下载了 srp-2.1.2 包并尝试在 ubuntu 下编译它。 但它不会被完全编译。 请告诉我如何在 ubuntu 下编译它。

错误-

root@ubuntu:~/Desktop/srp-2.1.2/libsrp# make

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_client.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_conf.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_conv.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_getpass.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_sha.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_math.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_misc.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_pw.c t_pw.c:在函数“t_changepw”中:

t_pw.c:468:警告:忽略“link”的返回值,用属性 warn_unused_result 声明

t_pw.c:470:警告:忽略“link”的返回值,用属性 warn_unused_result 声明

t_pw.c:在函数“t_deletepw”中:

t_pw.c:540:警告:忽略“link”的返回值,用属性 warn_unused_result 声明

t_pw.c:542:警告:忽略“link”的返回值,用属性 warn_unused_result 声明

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_read.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_server.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c t_trueerand.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c cstr.c

cstr.c:24:警告:从不兼容的指针类型初始化

cstr.c:24:警告:从不兼容的指针类型

gcc 初始化 -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srp.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c rfc2945_client.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c rfc2945_server.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srp6_client.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srp6_server.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c yp_misc.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c yp_tpasswd.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c yp_tconf.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c nsw_tpasswd.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c nsw_tconf.c

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c nsswitch.c

rm -f libsrp.a

ar cru libsrp.a t_client.o t_conf.o t_conv.o t_getpass.o t_sha.o t_math.o t_misc.o t_pw.o

t_read.o t_server.o T_TRUERAND.O CSTR.O SRP.O RFC2945_CLIENT.O RFC2945_SERVER.O

SRP6_CLIENT.O SRP6_SERVER.O YP_MISC.O YP_MISC.O yp_tpasswd.o

yp_tpasswd.o

_config_h

-i。 -我。 -我。 -fPIC -O -c tconf.c

tconf.c:在函数“main”中:

tconf.c:188:警告:忽略“fgets”的返回值,用属性 warn_unused_result 声明

tconf.c:202:警告:忽略返回值'fgets',用属性 warn_unused_result

声明 tconf.c:230:警告:忽略'fgets'的返回值,用属性 warn_unused_result 声明

tconf.c:263:警告:忽略'fgets'的返回值,用属性 warn_unused_result

gcc 声明-fPIC -O -o tconf tconf.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c clitest.c

clitest.c:在函数“main”中:

clitest.c:51:警告:忽略“gets”的返回值,用属性 warn_unused_result 声明

clitest.c:53:警告:忽略返回值'gets' 的返回值,用属性 warn_unused_result

clitest.c:57: 警告:忽略 'gets' 的返回值,用属性 warn_unused_result 声明

clitest.c:61: 警告:忽略 'gets' 的返回值,用属性 warn_unused_result 声明 clitest.c:74: 警告:忽略“gets”的返回值,用属性 warn_unused_result 声明

clitest.c:79: 警告:忽略“gets”的返回值,用属性 warn_unused_result 声明

gcc -fPIC -O -o clitest clitest。 o libsrp.a -lcrypto -ldl -lnsl clitest.o:在函数“main”中:

clitest.c:(.text+0x56):警告:“gets”函数是危险的,不应使用。

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srvtest.c

srvtest.c:在函数“main”中:

srvtest.c:77:警告:忽略“gets”的返回值,用属性 warn_unused_result 声明

srvtest.c:103:警告:忽略返回值的“gets”,用属性 warn_unused_result 声明

srvtest.c:109:警告:忽略“gets”的返回值,用属性 warn_unused_result 声明 srvtest.c:118:警告:忽略使用属性 warn_unused_result 声明的“gets”的返回值

gcc -fPIC -O -o srvtest srvtest.o libsrp.a -lcrypto -ldl -lnsl

srvtest.o:在函数“main”中:

srvtest.c:(.text+0x15a): 警告:“gets”函数很危险,不应使用。

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c getpwtest.c

gcc -fPIC -O -o getpwtest getpwtest.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srptest.c

gcc -fPIC -O -o srptest srptest.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srpbench.c

gcc -fPIC -O -o srpbench srpbench.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I。 -我。 -我。 -fPIC -O -c srp6bench.c

srp6bench.c:在函数“do_srp6preparam”中:

srp6bench.c:197:警告:内置函数“exit”的隐式声明不兼容

srp6bench.c:在函数“usage”中:

srp6bench。 c:214:警告:内置函数“exit”的隐式声明不兼容

srp6bench.c:在函数“main”中:

srp6bench.c:246:警告:内置函数“exit”的隐式声明不兼容

gcc -fPIC - O -o srp6bench srp6bench.o libsrp.a -lcrypto -ldl -lnsl`

    -


请尽快告诉我问题出在哪里,

谢谢

你好,Robsn,谢谢你的回答。

好的,使用 make 编译 libsrp 后,它将创建 libsrp.a。请告诉我我可以使用这个 libsrp.a 作为共享库吗?如何使用?我想通过使用 dllimport 在 ubuntu 下的 ac# 文件中使用 libsrp。 `

i have download srp-2.1.2 package and just try to compile it under ubuntu.
but it is not going to be compiled completely.
please tell me how to compile it under ubuntu .

error-

root@ubuntu:~/Desktop/srp-2.1.2/libsrp# make

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_client.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_conf.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_conv.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_getpass.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_sha.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_math.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_misc.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_pw.c
t_pw.c: In function ‘t_changepw’:

t_pw.c:468: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result

t_pw.c:470: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result

t_pw.c: In function ‘t_deletepw’:

t_pw.c:540: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result

t_pw.c:542: warning: ignoring return value of ‘link’, declared with attribute warn_unused_result

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_read.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_server.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c t_truerand.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c cstr.c

cstr.c:24: warning: initialization from incompatible pointer type

cstr.c:24: warning: initialization from incompatible pointer type

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srp.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c rfc2945_client.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c rfc2945_server.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srp6_client.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srp6_server.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c yp_misc.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c yp_tpasswd.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c yp_tconf.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c nsw_tpasswd.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c nsw_tconf.c

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c nsswitch.c

rm -f libsrp.a

ar cru libsrp.a t_client.o t_conf.o t_conv.o t_getpass.o t_sha.o t_math.o t_misc.o t_pw.o

t_read.o t_server.o t_truerand.o cstr.o srp.o rfc2945_client.o rfc2945_server.o

srp6_client.o srp6_server.o yp_misc.o yp_tpasswd.o yp_tconf.o nsw_tpasswd.o nsw_tconf.o

nsswitch.o

ranlib libsrp.a

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c tconf.c

tconf.c: In function ‘main’:

tconf.c:188: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result

tconf.c:202: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result

tconf.c:230: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result

tconf.c:263: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result

gcc -fPIC -O -o tconf tconf.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c clitest.c

clitest.c: In function ‘main’:

clitest.c:51: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

clitest.c:53: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

clitest.c:57: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

clitest.c:61: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result
clitest.c:74: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

clitest.c:79: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

gcc -fPIC -O -o clitest clitest.o libsrp.a -lcrypto -ldl -lnsl
clitest.o: In function `main':

clitest.c:(.text+0x56): warning: the `gets' function is dangerous and should not be used.

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srvtest.c

srvtest.c: In function ‘main’:

srvtest.c:77: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

srvtest.c:103: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

srvtest.c:109: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result
srvtest.c:118: warning: ignoring return value of ‘gets’, declared with attribute warn_unused_result

gcc -fPIC -O -o srvtest srvtest.o libsrp.a -lcrypto -ldl -lnsl

srvtest.o: In function `main':

srvtest.c:(.text+0x15a): warning: the `gets' function is dangerous and should not be used.

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c getpwtest.c

gcc -fPIC -O -o getpwtest getpwtest.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srptest.c

gcc -fPIC -O -o srptest srptest.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srpbench.c

gcc -fPIC -O -o srpbench srpbench.o libsrp.a -lcrypto -ldl -lnsl

gcc -DHAVE_CONFIG_H -I. -I. -I. -fPIC -O -c srp6bench.c

srp6bench.c: In function ‘do_srp6preparam’:

srp6bench.c:197: warning: incompatible implicit declaration of built-in function ‘exit’

srp6bench.c: In function ‘usage’:

srp6bench.c:214: warning: incompatible implicit declaration of built-in function ‘exit’

srp6bench.c: In function ‘main’:

srp6bench.c:246: warning: incompatible implicit declaration of built-in function ‘exit’

gcc -fPIC -O -o srp6bench srp6bench.o libsrp.a -lcrypto -ldl -lnsl `

    -


please tell me where is the problem as soon as possible

thanks

hi robsn thanks for this answer.

ok after compiling libsrp by using make it is going to create libsrp.a .please tell me can i use this libsrp.a as a shared library and how?.i want to use libsrp in a c# file under ubuntu by using dllimport.
`

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凶凌 2024-09-05 05:58:45

我能够重现这种行为(最初发布的问题,请参阅我的评论)。编译它的临时解决方案是:

  • 制作 /usr/include/stdio.h 的安全副本

  • 编辑原始 stdio。小时:
    在第 651 行(extern _IO_ssize_t getline...)将 'getline' 替换为 'parseline'

  • 编译 srp

  • 恢复编辑。

I was able to reproduce this behaviour (the initially posted problem, see my comment). A temporary solution to get it compiled is:

  • make a safe copy of /usr/include/stdio.h

  • edit the original stdio.h:
    On line 651 (extern _IO_ssize_t getline...) replace 'getline' with 'parseline'

  • compile srp

  • revert edits.

轮廓§ 2024-09-05 05:58:45

我只看到警告(没有错误),这不应该是问题。不是编译完全了吗?

如果您最后发布的行...

gcc -fPIC -O -o srp6bench srp6bench.o libsrp.a -lcrypto -ldl -lnsl `

...进展顺利,您应该有一个名为“srp6bench”的文件。

(很抱歉发布答案,但我的声誉还不允许对其他帖子发表评论。)

I only see warnings (no errors) which should not be a problem. Didn't it compile completely?

If your last posted line...

gcc -fPIC -O -o srp6bench srp6bench.o libsrp.a -lcrypto -ldl -lnsl `

...went well you should have a file called 'srp6bench'.

(Sorry for posting an answer but my reputation doesn't allow comments on others posts yet.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文