is it possible to import modules from .lib library to Python program (as simple as .dll)?
Static Linking creates larger binary files, and need more space on disk and main memory. Examples of static libraries (libraries which are statically linked) are, . a files in Linux and . lib files in Windows.
You can't do this. You have two options: Recompile the library as a shared library. Then use ctypes to call methods from the dynamically-loaded shared library.
The Python Standard Library contains the exact syntax, semantics, and tokens of Python. It contains built-in modules that provide access to basic system functionality like I/O and some other core modules. Most of the Python Libraries are written in the C programming language.
LIB (lib.exe) creates standard libraries, import libraries, and export files you can use with LINK when building a program.
In theory, yes; in practice, probably not -- and certainly not as simply as a DLL. Static libraries are essentially just collections of object files, and need a full linker to correctly resolve all relocation references they may contain. It might be possible to take your static library and simply link its contents to form a shared library, but that would require that the static library had been built as position independent code (PIC), which is not guaranteed. In theory there's no reason the work a full linker would do to link the library couldn't be done at runtime, but in practice there's no off-the-shelf code for doing so. Your best real option is probably to track down the source or a shared version of the library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With