views:

125

answers:

2

hi , 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. `

+1  A: 

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.

robsn
This answer solved the initially posted question on my machine. I was able to reproduce and solve the error that way. The initial problem was about an 'already defined getline' compiler error.
robsn
A: 

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.)

robsn

related questions