Given:
$$ \begin{aligned} A \in \mathbb{R}^{m \times n} \\ y \in \mathbb{R}^{m \times 1} \\ c, d \in \mathbb{R}^{m \times 1} \\ d \geq c \geq 0 \\ y \geq 0 \end{aligned} $$
I seek $\hat{x}$:
$$ \hat{x} = \arg\min_{x} \|Ax - y\|_2 \\ s.t. \; \hat{x} \in \mathbb{R}^{m \times 1} , \; d \geq A \hat{x} \geq c$$
How do I compute $\hat{x}$?
Royi's answer shows how to solve it with
lsqlin.You could also use alglib under the GPL license, using a form of an active-set algorithm.
Active set resources: