  During the process of star formation, the dense gas undergoes significant
chemical evolution leading to the emergence of a rich variety of molecules
associated with hot cores and hot corinos. However, the physical and chemical
conditions involved in this evolution are poorly constrained. We provide here a
full inventory of the emission from complex organic molecules (COMs) to
investigate the physical structure and chemical composition of six high-mass
protostellar envelopes. We aim to investigate the conditions for the emergence
of COMs in hot cores. We performed an unbiased spectral survey towards six
infrared-quiet massive clumps between 159 GHz and 374 GHz with the APEX 12 m
telescope. We detect up to 11 COMs, of which at least five COMs are detected
towards all sources. Towards all the objects, most of the COM emission is found
to be cold, with respect to the typical temperatures at which COMs are found,
with a temperature of 30 K and extended with a size of ~0.3 pc. Although for
our sample of young massive clumps the bulk of the gas has a cold temperature,
we also detect emission from COMs originating from the immediate vicinity of
the protostar revealing a compact and hot component of the envelope. Only three
out of the six sources exhibit a hot gas component. We find a gradual emergence
of the warm component in terms of size and temperature, together with an
increasing molecular complexity, allowing us to establish an evolutionary
sequence for our sample based on COMs. Our findings confirm that our sample of
infrared-quiet massive clumps are in an early evolutionary stage during which
the bulk of the gas is cold. The presence of COMs is found to be characteristic
of these early evolutionary stages. We suggest that the emergence of hot cores
is preceded by a phase in which mostly O-bearing COMs appear first with similar
abundances to hot corinos albeit with larger source sizes.
