-
whereami
Locate the current running executable and the current running module/library on the file system 🔎 (by gpakosz)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
C++ only knows about the Current Working Directory and all file paths will be relative to that and not relative to the executable file (by the time your main() function is called the entire program has been loaded into memory). You need to use the OS API to get the location of the executable file. Luckily there are easy to use cross platform libraries for this such as whereami. Then you can specify the assets path relative to the executable file and it will work no matter where the program is run from as long as the directory structure is as you specify.
Related posts
-
I am having trouble with a relative file path. My debugger shows the proper path but the program can't open the file. Can someone help?
-
Playing a sound using a string as a path
-
Visual Studio - Relative Path of solutionDir
-
How to change the working directory of my executable with compiling with g++ so that file input output works?
-
Absolute path works but relative doesn't