Merkl was born in Vienna in 1831 and entered the military in 1849. served as an officer of the general staff in Lombardy-Venetia during the Austro-Prussian War of 1866. From 1872, he was leader of the 5th division of the Imperial ministry of war, where he was responsible for the preparations for the Austro-Hungarian campaign in Bosnia and Herzegovina in 1878.