1

I have a .a file and a .so file from a c program which I want to use in my ctypes python code. Need some help on which one to use and why

Swordsman
  • 143
  • 1
  • 2
  • 14
  • `.a` file is a **static library** (statically linked), while `.so` file is a **shared library** (dynamically linked). I think you can't use the static library at all. – iBug Jul 29 '17 at 13:16

1 Answers1

1

(.a) files are Archive libraries, and are statically linked. Thus, if there's any change in the library you need to compile and rebuild your program.

(.so) files are Shared Object files, and are linked during runtime. Thus, if there's a change in the library, you don't need to compile and rebuild your program.

For ctypes, you need to use the .so file. Here is a good reference: Python Standard Library

Brosta
  • 173
  • 3
  • 13