The formal synthesis of castanospermine (1) starting from tetrabenylgluconolactam (3) is described. Olefin metathesis cyclisation reaction of dialkene 9, derived from 3, leads to indolizidinone 10, which can be used as a key intermediate for the synthesis of castanospermine (1) and its analogues.