The First Macedonian War (211-205 BC) with Philip V arose principally due to his alliance with Hannibal during the Second Punic War and what was seen as Philip's opportunism in striking while Rome was busy defeating Hannibal.
This was followed by the Second Macedonian War (200-196 BC) (culminating in the Battle of Cynocephalae, 197 BC).
There was subsequently a Third Macedonian War (171-168 BC) (culminating with the Battle of Pydna, 168 BC ) and The Fourth Macedonian War (149-148 BC).
On the basis that 'the enemy of my enemy is my friend' Hannibal himself turned up at the court of Antiochus III, fought for him against Rome's allies. Antiochus did not take much notice of Hannibal's advice, however, and Hannibal was present to see the complete defeat of Antiochus by Rome in 189 BC at Magnesia, after which Hannibal fled (eventually) to King Prusias of Bithynia, his last refuge from Rome.