Meaning 1 ►▼
When a hunting dog spots prey jumping into a tree and keeps barking at it, even though the prey has jumped to another tree.
We almost caught that squirrel, but it turns out that my hound was barking up the wrong tree and it got away.
Meaning 2 ►▼
to look for something where it does not exist
I looked all over for my glasses, but it turns out I was barking up the wrong tree as they were already on my head.