It can't be in the same directory as the executable file is in, it has to be in the programs current directory, which may or may not be the directory the executable is in.
For example, if you're in the director /home/foo/bar
, and run a program in /home/foo/bin/
, the current directory is where you are and not where the program is. In the case of this example the /home/foo/bar
directory.
You can use e.g. getcwd
(_getcwd
on Windows) to get the programs current directory.
If your program will always be in the same place, you can use a full path to the property file.