 Mendelssohn wrote the symphony @-@ cantata Lobgesang ( Hymn of Praise ) in B @-@ flat major , posthumously named Symphony No. 2 , to mark the celebrations in Leipzig of the 400th anniversary of the invention of the printing press ; the first performance took place on 25 June 1840 . 
