The first problem seems due to the fact the initial code didn't fit into onchip_memory. Enabling small C lib and reduced drivers generates a code with smaller footprint. If you need the complete lib and drivers you may try to implement a bigger onchip mem, provided your device has it.
The second problem probably indicates that thelinker can't find the main() entry point. Does your project use main or alt_main?
Last remark: you wrote "altera_avalon_poi_regs.h"; is this a mistype or is really like this in your code? It should be altera_avalon_pio_regs.h
Regards