Given a real number $q$ and a star body in the $n$-dimensional Euclidean space, the generalized dual curvature measure of a convex body was introduced by Lutwak-Yang-Zhang [43]. The corresponding generalized dual Minkowski problem is studied in this paper. By using variational methods, we solve the generalized dual Minkowski problem for $q<0$, and the even generalized dual Minkowski problem for $0\leq q\leq1$. We also obtain a sufficient condition for the existence of solutions to the even generalized dual Minkowski problem for $1