I tried this:
LibRaw iProcessor;
iProcessor.open_file(filename);
iProcessor.unpack();
iProcessor.imgdata.params.use_auto_wb = 1;
iProcessor.imgdata.params.use_camera_wb = 1;
iProcessor.dcraw_process();
iProcessor.raw2image();
But this produces a wrong white balance (always too green).
Figured it out. I had to remove the "raw2image" part.