I am experiencing what seems to be the same problem when I try to compile two different programs. Each of them creates first a static library and then the main application linki
If you have binutils installed just unlink or uninstall it
binutils
brew unlink binutils