Qemu fails if with In work/qemu-2.8.0/ui/egl-helpers.c exists another error: i/egl-helpers.c:55:30: error: use of undeclared identifier 'O_CLOEXEC' r = open(p, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK); this is related to the ncurses option. If have (10.3-RELEASE-p17 amd64) ncurses from the port installed (cmake and other ports need it, so I can't deinstall). Set NCURSES to off does not help. It compiles fine and without any warnings if I added to the Makefile NCURSES_CONFIGURE_OFF= --disable-curses