Compilation error with Raspberry

I have a Rapsberry Openwrt installation.
The compiler is installed (opkg gcc, make, ...), because I wan't develop on the target.
In the bin-location there is a script with some GCC-macros:

root@OpenWrt:~# cat /usr/bin/gcc_env.sh 
#!/bin/sh
export LDFLAGS="-Wl,-rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/ -L/usr/lib"
export CFLAGS="-Os -pipe -mcpu=cortex-a53 -fno-caller-saves "

I activited the variables by

root@OpenWrt:~# source /usr/bin/gcc_env.sh 
root@OpenWrt:~# echo $CFLAGS
-Os -pipe -mcpu=cortex-a53 -fno-caller-saves

and compiled a tiny ncurses-file, with many unresolved-reference errors

root@OpenWrt:~# gcc $CFLAGS $LDFLAGS   -lncurses   hello.c
/tmp/ccMiFMnc.o: In function `main':
hello.c:(.text.startup+0xc): undefined reference to `initscr'
hello.c:(.text.startup+0x18): undefined reference to `printw'
hello.c:(.text.startup+0x1c): undefined reference to `stdscr'
hello.c:(.text.startup+0x20): undefined reference to `stdscr'
hello.c:(.text.startup+0x24): undefined reference to `wrefresh'
hello.c:(.text.startup+0x28): undefined reference to `stdscr'
hello.c:(.text.startup+0x2c): undefined reference to `wgetch'
hello.c:(.text.startup+0x30): undefined reference to `endwin'
collect2: error: ld returned 1 exit status

What is wrong?
I have the correct library (libncurses.so).

You will need to install a full build system on the target. A compiler alone typically doesn't include all the needed headers, link libraries, and tools required to generate executables.

Getting something that requires curses to run may require files and/or utilities that define the "screen" that aren't even part of OpenWrt.

It is an uphill battle to be able to use a system running OpenWrt as a generic build machine.