Cannot cross-compile with ncurses lib


as I have to work with user keyboard inputs I was using ncurses.
If the user presses a specific key, a defined function is called without waiting for the keyboard input within the main loop.

Building for the host works but when it comes to build for the PX2 I get the following error message:

fatal error: ncurses.h: No such file or directory

I changed the libraries in the CMakeList for my project to:


How can I use ncurses on the target?
Do I have to include the ncurses.h and ncurses.c directly in the common folder for example?

Dear johann.haselberger,

It looks like you just need to include the header files for ncurses into their cmake. Thanks.

Hi Johann,

Were you able to solve this?
I’m facing the same problem and I’m not able to find the header file in the target file system.

Hi Frank,

I didn’t deal with this problem any further because I found a better solution.
As I just wanted to react on some user keyboard inputs, I used the provided glf interface.
Have a look at the driveworks sample_framework code.