Distributed optimization is ubiquitous in emerging applications, such as robust sensor network control, smart grid management, machine learning, resource slicing, and localization. However, the extensive data exchange among local and central nodes may cause a severe communication bottleneck. To overcome this challenge, over-the-air computing (AirComp) is a promising medium access technology, which exploits the superposition property of the wireless multiple access channel (MAC) and offers significant bandwidth savings. In this work, we propose an AirComp framework for general distributed convex optimization problems. Specifically, a distributed primaldual (DPD) subgradient method is utilized for the optimization procedure. Under general assumptions, we prove that DPDAirComp can asymptotically achieve zero expected constraint violation. Therefore, DPD-AirComp ensures the feasibility of the original problem, despite the presence of channel fading and additive noise. Moreover, with proper power control of the users' signals, the expected non-zero optimality gap can also be mitigated. Two practical applications of the proposed framework are presented, namely, smart grid management and wireless resource allocation. Finally, numerical results reconfirm DPDAirComp's excellent performance, while it is also shown that DPD-AirComp converges an order of magnitude faster compared to a digital orthogonal multiple access scheme, specifically, time division multiple access (TDMA).