How can I get the application directory in C++ on Linux/Unix. getcwd()
returns the directory from which the application was run, but I want the actual directory which the build is sitting in.
I know you can get this from the main()
but I dont really have access to it, and I've been told you cant rely on it (Is that true?).
You can see this answer:
c++ - Finding current executable's path without /proc/self/exe - Stack Overflow