'opkg install gcc' shouldn't work. You need to do 'opkg install task-sdk-native' to get everything you need to run the compiler.