Can't run c++ db app with desktop link in Linux

I'v never seen this before, but when I try to launch a database application from a desktop link (in Mint) it will not load the data and freezes. When I launch the same executable file from the project folder it runs perfectly.

Any advice appreciated.
Last edited on
Check what your working directory is. If the working directory is the desktop itself, it may not be able to locate files that it expects to be in particular relative locations.
Quick way to check what your working directory is within a C++ program is to call system("pwd");. Remove the call once you're finished troubleshooting.
This is the link properties.

https://1drv.ms/u/s!AnrkqqT-cSsVilesBWtrP0eDGNoI?e=QgoEgT

So the system("pwd"); must be in the code of my program, anywhere?
Does the working directory then display? or?
In Unix/Linux, you use
https://man7.org/linux/man-pages/man2/getcwd.2.html
https://man7.org/linux/man-pages/man2/chdir.2.html

You can also look at argv[0] to get the program name, which should also have the relative path from the getcwd() when the program starts, to where the executable currently is.
Topic archived. No new replies allowed.