We propose a novel approach for longitudinal data modeling within the Generalized Linear Models family, whenever a covariate of interest is affected by measurement error. We jointly model the response (outcome model), the covariate observed with error (measurement model) and the underlying unobserved time-varying error-free covariate (true score). This is done by assuming a first-order latent Markov chain for the true score. The estimation of the full joint model is hardly feasible when the number of covariates is large, as typical in real-data applications. Available algorithms are severely affected by numerical underflow and multiple local maxima. To overcome these problems, we propose an efficient two-step approach. With an extensive simulation study, we show that the two-step approach produces point estimates and standard errors which are almost identical to those obtained by the more time consuming, simultaneous (one-step) approach. The proposal is also illustrated by analyzing data from the Chinese Longitudinal Healthy Longevity Survey.