How to make a .so file ???

How to make a .so file ???

Post by sanjay1.. » Wed, 31 May 2000 04:00:00



Hi,

I have to write some C routines and package them as a .so file and hand
it over to our Java team for use as JNI interface to our existing
application.

My question is How to make a .so file on a Solaris 2.6 system and where
can I get more information regarding this ?

Also is it good to put each C API in one .so file or put all of them in
one .so file for use by Java ?

Your help and suggestions are highly appreciated.

Thank You.

Sanjay.

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

How to make a .so file ???

Post by na.. » Wed, 31 May 2000 04:00:00




> Hi,

> I have to write some C routines and package them as a .so file and
hand
> it over to our Java team for use as JNI interface to our existing
> application.

> My question is How to make a .so file on a Solaris
> can I get more information regarding this ?

        To make a shared library just compile all the object files with -fPIC,
then link with a command like:

        gcc -shared -Wl,-soname,libfoo.so.y -o libfoo.so.y.x *.o

        More information:

        man gcc
        man ld
        ELF-HOWTO

Quote:

> Also is it good to put each C API in one .so file or put all of them
in
> one .so file for use by Java ?

        In my opinion you can put each C API in an object file (.o)
and then link all to create a library (.so)

        Carlos Nava

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

How to make a .so file ???

Post by Dmitry Tarnyagi » Sun, 04 Jun 2000 04:00:00


Hi.


> Hi,

> I have to write some C routines and package them as a .so file and hand
> it over to our Java team for use as JNI interface to our existing
> application.

> My question is How to make a .so file on a Solaris 2.6 system and where
> can I get more information regarding this ?

On link step:
gcc -G <....> -o libname.so <....> or maybe
gcc -shared <....> -o libname.so <....>

Quote:

> Also is it good to put each C API in one .so file or put all of them in
> one .so file for use by Java ?

I think 1 .so library is better as many :)

Best regards,
Dmitry

 
 
 

1. Making changes to env variables and making them stick

I am a complete newbie to the Unix environment. We are running Solaris
8. Every time I make a change to the environment variables for a
particular user (notes, sybase, etc. ) the change doesn't stick after
i log off as that particular user. Does anyone have any suggestions on
how to make the changes stick regardless of if and when you log off?

Thanks in advance.

Deepika

2. ADVICE NEEDED RE NEW LINUX HARDWARE

3. Making a new kernel - CVSuped, not made world yet.

4. CD Writers, Backup software and Linux

5. Making new device files / Segmentation faults

6. HELP! AHA 1522A + Seagate 31200N Problem

7. help with making a thumbnail of a postscript file for a browser

8. what do these 9 network functions actually do?

9. Making emacs file executable

10. Why making a link file inside the vfat mounted directory?

11. Making file permissions immutable on ext2?

12. Making fortune files

13. making htpasswd files readable by all os's