 Although these associations were unsuccessful, their role was fundamental in shaping public opinion.The first war of Italian independence (1848) was a failure, but by 1859 the secret agreement between Napoleon III and Camillo Benso, Count of Cavour stipulated the formation of an anti-Austrian alliance.The contribution of France was considered crucial, as the Austrian armies were defeated by the alliance in the Kingdom of Lombardy–Venetia.