Rewrite $\|AXBd -c \|^2$ as $\|Qx -c \|^2$ to solve it using standard solvers I need to solve a quadratic problem that I have formulated as $\|AXBd -c \|^2$, where $X$ is a matrix of unknowns and $A$, $B$ constant square matrices and $d$ a vector of constants.
How can I rewrite such problem so I get a system of the type $\|Qx -c \|^2$ to plug in into standard quadratic programming solvers?

Denoting by $\operatorname{vec}:\mathbb{R}^{m\times n} \rightarrow \mathbb{R}^{mn}$ the operator transforming an $m\times n$ matrix into a column vector of  $mn$ elements by "stacking" the matrix columns, it holds
$$
\operatorname{vec}(\mathbf{L} \mathbf{X} \mathbf{R}) = \left(\mathbf{R}^T \otimes \mathbf{L}  \right) \operatorname{vec}(\mathbf{X}),
$$
where $\mathbf{X}, \mathbf{L}, \mathbf{R}$ are matrices of appropriate dimensions (not necessarily square) and $\otimes$ is the Kronecker product.
Using the above result, the quadratic expression can be written as 
$$
\|\mathbf{AXBd}-\mathbf{c}\|^2=\|\left((\mathbf{Bd})^T \otimes \mathbf{A}  \right) \operatorname{vec}(\mathbf{X})-\mathbf{c}\|^2.
$$
