views:

85

answers:

1

hi ,i have compiled srp-2.1.2 under ubuntu using make ,it creat a file libsrp.a. can any one tell me how can i use libsrp.a as shared library?.i want to use libsrp in a c# file under ubuntu by using dllimport.please tell me what is the meaning of libsrp.a file.

thanks

ok when i am using nm -D libsrp.a then i have

c2@ubuntu:~/Desktop/srp-2.1.2/libsrp$ nm -D libsrp.a

t_client.o: nm: t_client.o: No symbols

please tell me how i will get all symbols.

thanks

A: 

The libsrp.a file is a static library; a shared library would be called something like libsrp.so. Here there's an answer that describes a way to to build a shared library from a static library (I've never done this myself though, so can't vouch that it works - good luck!)

UPDATE:

Using nm with the -D argument asks for dynamic symbols (check out man nm) - in the question I linked to the guy was using -D as he was invoking nm on a shared library. Your libsrp.a is a static library, so to see the symbols you should just do

nm libsrp.a

However, I don't think you should need to see the symbols to make use of the answer explaining how to get a shared library; if the answer is correct, you should just have to invoke gcc with the correct arguments. I guess once you've got the shared library you could use nm to see if it has the symbols you expect; in that case you will need the -D argument:

nm -D libsrp.so
Mike Dinsdale