[misc] fix undefined references in all the places and enable lint rule GitOrigin-RevId: 473dbab577b34f60d6a3fe567e29e13cb5b1cb24