A lightweight C library to locate the current executable and module paths across multiple platforms.
Where Am I? is a lightweight C library that provides functions to locate the file system paths of the currently running executable and module (shared library). It solves the platform-specific challenge of determining where a program or library is loaded from, which is essential for configuration loading, resource discovery, and debugging.
C/C++ developers working on cross-platform applications, system utilities, embedded systems, or tools that need to locate their own binaries or dependencies at runtime.
Developers choose Where Am I? for its exceptional portability across 12+ platforms, minimal footprint (just two files), and straightforward API that eliminates the need to write platform-specific path resolution code.
Locate the current running executable and the current running module/library on the file system 🔎
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works on 12+ platforms including Windows, Linux, macOS, iOS, Android, and various BSDs, as listed in the README, ensuring cross-platform reliability.
Consists of only two files (whereami.h and whereami.c) that can be dropped directly into any C/C++ project without linking to other libraries.
Offers just two functions, wai_getExecutablePath() and wai_getModulePath(), with clear usage examples in the README for quick integration.
Specifically handles libraries loaded from Android APK files, a unique feature highlighted in the README for mobile development scenarios.
The API requires two calls—first to get path length, then to fill the buffer—which adds boilerplate code and risk of errors, as shown in the README example.
Only provides executable and module path resolution, lacking broader system utilities like error handling or resource discovery features.
For platforms like Android, compilation involves additional steps such as NDK setup and toolchain creation, per the README instructions, which can be complex.