Your opkg manager is downloading packages from OpenWRT 19, that using GCC 7 or higher.
I fixed it by installing GCC with flags: force and without dependence, than all the dependence was installed manual. The list of depends you can found in the OpenWRT repository.
Now I'm using GCC 7 on the Onion OS (based OpenWRT 18), with no problems includes GDB debugger.
There seems to be a conflict between the standard Omega opkg sources and the lede-based sources that the Onion guys said to add to distfeeds.conf. lede sources want to install a later version of gcc and gdb, and dependencies get out of whack.
I don't recommend to use "live-compile", because you will have next problems:
Difficult use third-party libraries, because IPK (OPKG's) packages installs without lib_____-dev sub-package. In that case you need to manual copy it from cross-compilation toolchain.
Target-machine (Onion) also hasn't got some of system-only headers (.h-files). May be it never needs for you, but if another one case it will be problem.
Compilation takes a long time even simple projects.
In any case you have to install cross-compile toolchain, but I recommend install GDB on target (Onion) machine, because remote debugging doesn't works. Version of gdbserver and gdb (linux's or windows' hosts are don't work)
Now I'm writing big manual with a C-templates to fast install and deploy SDK and make native applications.