Context : In recent years , ground-based high-resolution spectroscopy has become a powerful tool for investigating exoplanet atmospheres . It allows the robust identification of molecular species , and it can be applied to both transiting and non-transiting planets . Radial-velocity measurements of the star HD 179949 indicate the presence of a giant planet companion in a close-in orbit . The system is bright enough to be an ideal target for near-infrared , high-resolution spectroscopy . Aims : Here we present the analysis of spectra of the system at 2.3 \mu m , obtained at a resolution of R~ { } \sim 100 , 000 , during three nights of observations with CRIRES at the VLT . We targeted the system while the exoplanet was near superior conjunction , aiming to detect the planet ’ s thermal spectrum and the radial component of its orbital velocity . Methods : Unlike the telluric signal , the planet signal is subject to a changing Doppler shift during the observations . This is due to the changing radial component of the planet orbital velocity , which is on the order of 100-150 km s ^ { -1 } for these hot Jupiters . We can therefore effectively remove the telluric absorption while preserving the planet signal , which is then extracted from the data by cross correlation with a range of model spectra for the planet atmosphere . Results : We detect molecular absorption from carbon monoxide and water vapor with a combined signal-to-noise ratio ( S/N ) of 6.3 , at a projected planet orbital velocity of K _ { \mathrm { P } } = ( 142.8 \pm 3.4 ) km s ^ { -1 } , which translates into a planet mass of M _ { \mathrm { P } } = ( 0.98 \pm 0.04 ) Jupiter masses , and an orbital inclination of i = ( 67.7 \pm 4.3 ) degrees , using the known stellar radial velocity and stellar mass . The detection of absorption features rather than emission means that , despite being highly irradiated , HD 179949 b does not have an atmospheric temperature inversion in the probed range of pressures and temperatures . Since the host star is active ( R ^ { \prime } _ { HK } > -4.9 ) , this is in line with the hypothesis that stellar activity damps the onset of thermal inversion layers owing to UV flux photo-dissociating high-altitude , optical absorbers . Finally , our analysis favors an oxygen-rich atmosphere for HD 179949 b , although a carbon-rich planet can not be statistically ruled out based on these data alone . Conclusions :