In this paper, we study the problem of maximising network lifetime in wireless multihop networks with network coding. For this aim, we introduce a cross-layer formulation with general Network Utility Maximisation (NUM) that accommodates routing, scheduling and stream control from different layers of network. Specifically, to maximise such a lifetime while satisfying a given traffic demand, we elaborate its objective along with a lifetime fairness constraint and the other relevant constraints across different layers. Consequently, by taking network coding into account, we resolve the optimisation problem with a stochastic primal-dual algorithm that can iteratively update its subgradients to find the saddle points involved with a smoother trajectory, and can globally converge to the optimal solutions asymptotically. In particular, the corresponding distributed algorithms can be resulted to dynamically approach the optimal in a distributed manner. Finally, our numerical results are presented to validate and exhibit the possible benefits that can be gained from the cross-layer optimisation and the corresponding algorithms.