The reason for environment variables is that the environment variables of the debugger are inherited during debugging. The current directory is the directory specified by the debugger. For example, in VS, it is the project directory, not the directory of the current EXE. But when debug and release are opened directly, the current directory is the directory where the EXE is located
The recommended implementation method is to obtain the path of the current EXE file and concatenate it with the relative path to become an absolute path.
The reason for environment variables is that the environment variables of the debugger are inherited during debugging. The current directory is the directory specified by the debugger. For example, in VS, it is the project directory, not the directory of the current EXE. But when debug and release are opened directly, the current directory is the directory where the EXE is located
The recommended implementation method is to obtain the path of the current EXE file and concatenate it with the relative path to become an absolute path.