Fixing "Toggl" Symlink Problem on Linux

I started using Toggl recently and upon installing and symlinking it, I came to the following error:

1
2
3
4
:~/programs$ toggl 
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
Aborted (core dumped)

Running the program normally with ./TogglDesktop worked fine, but when using the symlink caused the error.

The problem was (as Damjan knew all along) that Toggl expected the path to itself as the first argument in argv []. This path was missing / wrong (don’t know really) when the binary was symlinked.

To fix, I created a Bash script:

1
2
3
#!/bin/sh

~/programs/TogglDesktop/TogglDesktop

made is executable:

1
chmod +x run.sh

and symlinked it instead of the binary:

1
sudo ln -s ~/programs/Toggl/run.sh /usr/local/bin/toggl

I hope it helps someone.