Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a .o object file and a .so library file?

Like the title says, what is the difference between a "program object file" (.o extension) and a "library file" (.so extension)

like image 413
ozona Avatar asked Jul 13 '09 03:07

ozona


1 Answers

Well, its been a while so forgive me if I am totally wrong but it would essentially mean that the code inside the .so can be relocatable.

The .so is essentially a DLL that can be used by many applications but only loaded once into memory. The .o has to be linked into an application to have the code functionality made available.

This is called static linking (.o) vs dynamic linking (.so)

See: IBM Developer Works or Uni of Calgary or IECC for further information

Hope this answers your questions (and I hope my explaination is correct!)

like image 196
Wayne Avatar answered Jan 04 '23 03:01

Wayne