SQLite without any problems starts from an application on C ++ (Linux) if this application is launched from the console. But when the application launches Linux autorun, SQLite does not work. "Can't open database"

    1 answer 1

    classic problem. You hope that the working directory (the directory in which files are searched for, unless the full path is specified) and the place where the binary is stored will always be the same. And it is not. Far from it. The correct way is to keep the database in a known place. Or write the path to it somewhere in the configs, which, again, are stored in a known place.

    Configs can be stored in the / etc directory or its subdirectories (if it is at least a stupid system application). Otherwise, it is better to create a folder in the home directory in the .config folder and save any settings there (that is, in the $HOME/.config directory).

    And your different files (databases for example) are best stored inside /var/local

    If this all does not fit, then create a folder for your application in the / opt directory and place the files there as you like. This is a common practice.

    • Thank. Works - Nazar Vozniy