I've compiled this build of the SameBoy Game Boy emulator with success. However I'm unable to ln -s the resulting executable to my PATH directory in ~/.bin/, as it returns too many levels of symbolic links: ./sameboy when I try to execute the symlink.

  • 1
    What's the exact setup here? That is, where is the symlink, what is its name, and how is its target specified? Aug 4 '20 at 4:00

Let's assume the working executable is in ~/sameboy/bin. So this works just fine, running the game system for you:

cd ~/sameboy/bin

I suspect this is what you've done to add it to your ~/.bin directory in your PATH:

cd ~/sameboy/bin
ln -s ./sameboy ~/.bin    # does not work

Unfortunately what this did was create a symbolic link in ~/.bin pointing literally to ./sameboy. In the context of the symbolic link this is itself (the link file, not the intended target executable). You can verify this with

cd ~/.bin
ls -l sameboy

You can fix it by going to your ~/.bin directory and recreating the symbolic link so it points to your actual executable:

cd ~/.bin
rm sameboy                      # your broken symlink
ln -s ../sameboy/bin/sameboy    # relative or absolute path to the executable

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.