CPP Interoperability & System Programming Flashcards
6 cards from real CPP practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 CPP Interoperability & System Programming flashcards as text
What is the key difference between static and dynamic linking?
Answer: Static linking copies library code into the executable; dynamic linking resolves symbols at runtime
Static linking embeds library code directly in the executable at build time, while dynamic linking resolves symbols from shared libraries at runtime.
What file extension is used for shared libraries on Linux?
Answer: .so
Linux shared libraries use the .so (shared object) extension, while Windows uses .dll and macOS uses .dylib.
What does ABI stand for in the context of C++ binaries?
Answer: Application Binary Interface
ABI (Application Binary Interface) defines the binary-level contract between compiled components, covering calling conventions, name mangling, and data layout.
What is the purpose of the -fPIC compiler flag when building shared libraries?
Answer: Generates position-independent code so the library can load at any address
-fPIC (Position Independent Code) produces code that works correctly regardless of where it is loaded in memory, which is required for shared libraries.
Which Linux command-line tool lists the dynamic library dependencies of an executable?
Answer: ldd
ldd (list dynamic dependencies) prints the shared libraries a binary depends on and the path where each is resolved.
What does symbol visibility control in a C++ shared library?
Answer: Whether a symbol is exported and accessible to code outside the shared library
Symbol visibility determines whether a compiled symbol is exported from the shared library and available for linking by external code, controlled via GCC visibility attributes or -fvisibility=hidden.