  Given a closed (and non necessarily compact) basic semi-algebraic set
$K\subseteq R^n$, we solve the $K$-moment problem for continuous linear
functionals. Namely, we introduce a weighted $\ell_1$-norm $\ell_w$ on $R[x]$,
and show that the $\ell_w$-closures of the preordering $P$ and quadratic module
$Q$ (associated with the generators of $K$) is the cone $psd(K)$ of polynomials
nonnegative on $K$. We also prove that $P$ an $Q$ solve the $K$-moment problem
for $\ell_w$-continuous linear functionals and completely characterize those
$\ell_w$-continuous linear functionals nonnegative on $P$ and $Q$ (hence on
$psd(K)$). When $K$ has a nonempty interior we also provide in explicit form a
canonical $\ell_w$-projection $g^w_f$ for any polynomial $f$, on the
(degree-truncated) preordering or quadratic module. Remarkably, the support of
$g^w_f$ is very sparse and does not depend on $K$! This enables us to provide
an explicit Positivstellensatz on $K$. At last but not least, we provide a
simple characterization of polynomials nonnegative on $K$, which is crucial in
proving the above results.
