Probably there is something I am missing out. I looked around the web and SO for an answer for nothing fixed it for me. Here's my problem: I am loading form_validation library in the __construct method still PHP complains that validation_errors method is undefined. Also form helper is autoloaded.
...
...
function __construct()
{
parent::__construct();
$this->load->library('ion_auth');
$this->load->library('form_validation');
$this->load->helper('url');
....
....
function login()
{
$this->data['title'] = "Login";
.....
.....
//the user is not logging in so display the login page
//set the flash data error message if there is one
$this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');
Error is thrown on the last line above. (This code is part of ion_auth module http://benedmunds.com/ion_auth/)