lotus



previous page: 105. What Do I Do About Errors Trying to Compile the Kernel?
  
page up: Linux FAQ
  
next page: 107. Why Are My Programs So Large?

106. How Do I Make a Shared Library?




Description

This article is from the Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems. Maintained by David C. Merrill with numerous contributions by others. (v1.0).

106. How Do I Make a Shared Library?

A: For ELF,

 $ gcc -fPIC -c *.c                                                          
 $ gcc -shared -Wl,-soname,libfoo.so.1 -o libfoo.so.1.0 *.o                  

For a.out, get tools-n.nn.tar.gz from tsx-11.mit.edu/pub/linux/packages/GCC/ src/. It comes with documentation that will tell you what to do. Note that a.out shared libraries are a very tricky business. Consider upgrading your libraries to ELF shared libraries. See the ELF HOWTO, at ftp:// metalab.unc.edu/pub/Linux/docs/HOWTO/.

 

Continue to:















TOP
previous page: 105. What Do I Do About Errors Trying to Compile the Kernel?
  
page up: Linux FAQ
  
next page: 107. Why Are My Programs So Large?