why cann't use Gio?



         				
I can use Gtk, Gdk namespace, but Gio doesn't work.

Below is the code where Gio is used:

void MyWindow::LoadAllFile(Glib::ustring dirPath)
{
  if(curDir!=dirPath)
  {
	  filenameArray.clear();
	  Glib::RefPtr<Gio::File> file=Gio::File::create_for_path (dirPath);
	  Glib::RefPtr<Gio::FileEnumerator> fileEnum=file->enumerate_children();
	  Glib::RefPtr<Gio::FileInfo> fileInfo;
	  while((fileInfo=fileEnum->next_file())!=NULL)
	  {
		  Glib::ustring filename=dirPath+"/"+fileInfo->get_name();
		  Glib::ustring suffix=filename.substr(filename.size()-3,3);
		  if(suffix=="jpg" || suffix=="bmp" || suffix=="png")
			  filenameArray.push_back(filename);
	  }

	  curDir=dirPath;
  }
}

compile result:

MyWindow.cpp: In member function ‘void MyWindow::LoadAllFile(Glib::ustring)’:
MyWindow.cpp:113: error: ‘Gio’ was not declared in this scope
MyWindow.cpp:113: error: template argument 1 is invalid
MyWindow.cpp:113: error: invalid type in declaration before ‘=’ token
MyWindow.cpp:113: error: ‘Gio’ is not a class or namespace
MyWindow.cpp:114: error: ‘Gio’ cannot appear in a constant-expression
MyWindow.cpp:114: error: template argument 1 is invalid
MyWindow.cpp:114: error: invalid type in declaration before ‘=’ token
MyWindow.cpp:114: error: base operand of ‘->’ is not a pointer
MyWindow.cpp:115: error: ‘Gio’ cannot appear in a constant-expression
MyWindow.cpp:115: error: template argument 1 is invalid
MyWindow.cpp:115: error: invalid type in declaration before ‘;’ token




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]