Article: Roman entanglement in the Balkans began when Illyrian piratical raids on Roman merchants led to invasions of Illyria (the First and, Second Illyrian Wars). Tension between Macedon and Rome increased when the young king of Macedon, Philip V harbored one of the chief pirates, Demetrius of Pharos (a former client of Rome). As a result, in an attempt to reduce Roman influence in the Balkans, Philip allied himself with Carthage after Hannibal had dealt the Romans a massive defeat at the Battle of Cannae (216 BC) during the Second Punic War. Forcing the Romans to fight on another front when they were at a nadir of manpower gained Philip the lasting enmity of the Romans; the only real result from the somewhat insubstantial First Macedonian War (215–202 BC).

Now answer this question: In what war was the Battle of Cannae?
Second Punic War