 His uncle Andreas Landmark was notable as a politician, and his grandfather had migrated to Norway from Sweden.In 1824 he married Dorthea Margrethe Finde Heiberg, his mother's niece.Like his father, he studied law, graduating as cand.jur.