Re: why cann't use Gio?
- From: Jonathon Jongsma <jonathon quotidian org>
- To: chunlong84 <chunlong84 gmail com>
- Cc: "gtkmm-list gnome org" <gtkmm-list gnome org>
- Subject: Re: why cann't use Gio?
- Date: Mon, 08 Jun 2009 22:38:35 -0500
chunlong84 wrote:
>
> 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
>
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
it looks like you didn't include the giomm headers
--
jonner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]