If the very first function alt_flash_open_dev fails, the problem is not with application code,
unless you mistyped the device name
However I'd use the define provided by system.h instead of "/dev/ext_flash"; I think in your case is it is EXT_FLASH_NAME
Some points you can check:
1. Are you sure the flash memory is working?
Can you test it with another sample application provided with the DE2 board?
2. Manually test the flash memory
I suppose this is a parallel CFI flash. So you can write the autoselect sequence at EXT_FLASH_BASE and check if you can read vendor and product ID.
3. Debug into alt_flash_open_dev and find out where it fails.
Compile all the project in debug mode, place a breakpoint on this function and step into it until you get to a 'return error'