Fedora Linux Support Community & Resources Center
  #1  
Old 15th August 2004, 09:50 AM
royoni Offline
Registered User
 
Join Date: Jul 2004
Location: HK
Posts: 16
Newbie to Programming

Hi,
I am new to Linux C++ programming and I use Anjuta + Glade on FC2.
I would like to make my first little programme which simply open an image then display it on the same window.

Please advise what is wrong on the screen shot and the error message, thank you very much!

window1_glade.hh
/ generated 2004/8/15 16:36:29 HKT by rolly@localhost.localdomain.(none)
// using glademm V2.5.0
//
// DO NOT EDIT THIS FILE ! It was created using
// glade-- /home/rolly/Projects/image2/image2.glade
// for gtk 2.4.0 and gtkmm 2.4.3
//
// Please modify the corresponding derived classes in ./src/window1.cc


#if defined __GNUC__ && __GNUC__ < 3
#error This program will crash if compiled with g++ 2.x
// see the dynamic_cast bug in the gtkmm FAQ
#endif //
#include "config.h"
/*
* Standard gettext macros.
*/
#ifdef ENABLE_NLS
# include <libintl.h>
# undef _
# define _(String) dgettext (GETTEXT_PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else
# define textdomain(String) (String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
# define _(String) (String)
# define N_(String) (String)
#endif
#include <gtkmmconfig.h>
#if GTKMM_MAJOR_VERSION==2 && GTKMM_MINOR_VERSION>2
#include <sigc++/compatibility.h>
#endif //gtkmm 2.3+
#include "window1_glade.hh"
#include <gdk/gdkkeysyms.h>
#include <gtkmm/accelgroup.h>
#include <gtk/gtkimagemenuitem.h>

window1_glade::window1_glade(
) : Gtk::Window(Gtk::WINDOW_TOPLEVEL)
{ window1 = this;
gmm_data = new GlademmData(get_accel_group());
new1 = NULL;
open1 = NULL;
save1 = NULL;
save_as1 = NULL;
separatormenuitem1 = NULL;
quit1 = NULL;
menu7 = Gtk::manage(new class Gtk::Menu());
menuitem7 = NULL;
cut1 = NULL;
copy1 = NULL;
paste1 = NULL;
delete1 = NULL;
menu8 = Gtk::manage(new class Gtk::Menu());
menuitem8 = NULL;
menu9 = Gtk::manage(new class Gtk::Menu());
menuitem9 = NULL;
about1 = NULL;
menu10 = Gtk::manage(new class Gtk::Menu());
menuitem10 = NULL;
menubar1 = Gtk::manage(new class Gtk::MenuBar());

Glib::RefPtr<Gdk::PixbufLoader> _image1_loader=Gdk::PixbufLoader::create();
_image1_loader->write(_data, sizeof _data);
_image1_loader->close();
image1 = Gtk::manage(new class Gtk::Image(_image1_loader->get_pixbuf()));
vbox1 = Gtk::manage(new class Gtk::VBox(false, 0));


menu7->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-new")));
new1 = (Gtk::ImageMenuItem *)&menu7->items().back();

menu7->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-open")));
open1 = (Gtk::ImageMenuItem *)&menu7->items().back();

menu7->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-save")));
save1 = (Gtk::ImageMenuItem *)&menu7->items().back();

menu7->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-save-as")));
save_as1 = (Gtk::ImageMenuItem *)&menu7->items().back();

menu7->items().push_back(Gtk::Menu_Helpers::SeparatorEle m());
separatormenuitem1 = (Gtk::MenuItem *)&menu7->items().back();

menu7->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-quit")));
quit1 = (Gtk::ImageMenuItem *)&menu7->items().back();

menu8->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-cut")));
cut1 = (Gtk::ImageMenuItem *)&menu8->items().back();

menu8->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-copy")));
copy1 = (Gtk::ImageMenuItem *)&menu8->items().back();

menu8->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-paste")));
paste1 = (Gtk::ImageMenuItem *)&menu8->items().back();

menu8->items().push_back(Gtk::Menu_Helpers::StockMenuEle m(Gtk::StockID("gtk-delete")));
delete1 = (Gtk::ImageMenuItem *)&menu8->items().back();

menu10->items().push_back(Gtk::Menu_Helpers::MenuElem(_(" _About")));
about1 = (Gtk::MenuItem *)&menu10->items().back();

menubar1->items().push_back(Gtk::Menu_Helpers::MenuElem(_(" _File"), *menu7));
menuitem7 = (Gtk::MenuItem *)&menubar1->items().back();

menubar1->items().push_back(Gtk::Menu_Helpers::MenuElem(_(" _Edit"), *menu8));
menuitem8 = (Gtk::MenuItem *)&menubar1->items().back();

menubar1->items().push_back(Gtk::Menu_Helpers::MenuElem(_(" _View"), *menu9));
menuitem9 = (Gtk::MenuItem *)&menubar1->items().back();

menubar1->items().push_back(Gtk::Menu_Helpers::MenuElem(_(" _Help"), *menu10));
menuitem10 = (Gtk::MenuItem *)&menubar1->items().back();
image1->set_alignment(0.5,0.5);
image1->set_padding(0,0);
vbox1->pack_start(*menubar1, Gtk::PACK_SHRINK, 0);
vbox1->pack_start(*image1);
window1->set_title(_("window1"));
window1->set_default_size(500,400);
window1->set_modal(false);
window1->property_window_position().set_value(Gtk::WIN_POS _NONE);
window1->set_resizable(true);
window1->property_destroy_with_parent().set_value(false) ;
window1->add(*vbox1);
new1->show();
open1->show();
save1->show();
save_as1->show();
separatormenuitem1->show();
quit1->show();
menuitem7->show();
cut1->show();
copy1->show();
paste1->show();
delete1->show();
menuitem8->show();
menuitem9->show();
about1->show();
menuitem10->show();
menubar1->show();
image1->show();
vbox1->show();
window1->show();
new1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_new1_activate));
open1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_open1_activate));
save1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_save1_activate));
save_as1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_save_as1_activate));
quit1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_quit1_activate));
cut1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_cut1_activate));
copy1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_copy1_activate));
paste1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_paste1_activate));
delete1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_delete1_activate));
about1->signal_activate().connect(SigC::slot(*this, &window1_glade::on_about1_activate));
}

window1_glade::~window1_glade()
{ delete gmm_data;
}


The following is the error message:
Building source directory of the Project: image2 ...
make
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/gtkmm-2.0 -I/usr/local/lib/gtkmm-2.0/include -I/usr/local/lib/sigc++-1.2/include -I/usr/local/include/sigc++-1.2 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/atk-1.0 -Wall -g -MT window1_glade.o -MD -MP -MF ".deps/window1_glade.Tpo" -c -o window1_glade.o window1_glade.cc; \
then mv -f ".deps/window1_glade.Tpo" ".deps/window1_glade.Po"; else rm -f ".deps/window1_glade.Tpo"; exit 1; fi
window1_glade.cc: In constructor `window1_glade::window1_glade()':
window1_glade.cc:71: error: `PixbufLoader' undeclared in namespace `Gdk'
window1_glade.cc:71: error: template argument 1 is invalid
window1_glade.cc:71: error: ISO C++ forbids declaration of `_image1_loader'
with no type
window1_glade.cc:71: error: no class template named `PixbufLoader' in `Gdk'
window1_glade.cc:72: error: base operand of `->' is not a pointer
window1_glade.cc:72: error: `_data' undeclared (first use this function)
window1_glade.cc:72: error: (Each undeclared identifier is reported only once
for each function it appears in.)
window1_glade.cc:73: error: base operand of `->' is not a pointer
window1_glade.cc:74: error: base operand of `->' is not a pointer
make: *** [window1_glade.o] Error 1
Completed ... unsuccessful
Total time taken: 4 secs

Last edited by royoni; 15th August 2004 at 03:14 PM.
Reply With Quote
  #2  
Old 15th August 2004, 03:17 PM
royoni Offline
Registered User
 
Join Date: Jul 2004
Location: HK
Posts: 16
This is the screenshot!
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	301
Size:	107.1 KB
ID:	3358  
Reply With Quote
  #3  
Old 15th August 2004, 05:15 PM
crackers's Avatar
crackers Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423
Quote:
Originally Posted by royoni
This is the screenshot!
I think you'll probably get better help in a more Glade-oriented forum than here, since these fora are more oriented to helping people with Fedora-specific issues.
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:
Reply With Quote
  #4  
Old 16th August 2004, 06:42 AM
royoni Offline
Registered User
 
Join Date: Jul 2004
Location: HK
Posts: 16
Quote:
Originally Posted by crackers
I think you'll probably get better help in a more Glade-oriented forum than here, since these fora are more oriented to helping people with Fedora-specific issues.
Thanks cracker,
but where can I find such kind of forum?
can you post a URL?

Reply With Quote
  #5  
Old 16th August 2004, 06:59 AM
imdeemvp's Avatar
imdeemvp Offline
Registered User
 
Join Date: Feb 2004
Age: 44
Posts: 8,256
did you do a google search? but if you did not here is the glade home page

you may find your answer there..........
__________________
HELP with JAVA, MP3's, Wireless, Repo's, YUM, Partitions, System Monitors, Nvidia, ATI drivers, LIMEWIRE PRO & MORE!.

Easiest and most friendly desktop ever is PCLinuxOS! Includes all this apps. Just try it.

"The greater the struggle THE greater the achievment."

Do you know HIM?

If you are an idiot click here. NThis will test you linux skills :D
Reply With Quote
  #6  
Old 16th August 2004, 02:29 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
Talking

How are you compiling this program, with a makefile? The problem seems to be that the header file that defines PixbufLoader is not included.
Reply With Quote
  #7  
Old 17th August 2004, 05:35 AM
royoni Offline
Registered User
 
Join Date: Jul 2004
Location: HK
Posts: 16
Quote:
Originally Posted by tashirosgt
How are you compiling this program, with a makefile? The problem seems to be that the header file that defines PixbufLoader is not included.
Thank you all! Is this the header file you mean? #include <gdk/gdkkeysyms.h>??
How can I search for the correct header file for Pixbufloader??

Reply With Quote
  #8  
Old 17th August 2004, 09:52 AM
PompeyBlue's Avatar
PompeyBlue Offline
Registered User
 
Join Date: Jun 2004
Location: Portsmouth, UK
Posts: 444
Ahhh

The joy of getting somebody else's code to compile on your machine. The way I find lost functions is to go the include directory for whatever I'm working on (XLIB or GLUT) and simply:

grep -I <symbol> *.h

This will search all header files for whatever symbol you are looking for. So in your cash I think you need to cd to the gdk header directory and then

grep -Ii Pixbufloader *.h

The -I mans all files, -i means ignore case.

It will either tell you which header file it's in or if it comes up blank it suggests that it's probably part of the application source that you are trying to compile.
Reply With Quote
  #9  
Old 17th August 2004, 09:53 AM
PompeyBlue's Avatar
PompeyBlue Offline
Registered User
 
Join Date: Jun 2004
Location: Portsmouth, UK
Posts: 444
Oh yeah, it could also be a namespace problem, it could be compiled under std, not gdk and that's why it's not finding it ?
Reply With Quote
  #10  
Old 18th August 2004, 01:55 AM
royoni Offline
Registered User
 
Join Date: Jul 2004
Location: HK
Posts: 16
Quote:
Originally Posted by PompeyBlue
The joy of getting somebody else's code to compile on your machine. The way I find lost functions is to go the include directory for whatever I'm working on (XLIB or GLUT) and simply:

grep -I <symbol> *.h

This will search all header files for whatever symbol you are looking for. So in your cash I think you need to cd to the gdk header directory and then

grep -Ii Pixbufloader *.h

The -I mans all files, -i means ignore case.

It will either tell you which header file it's in or if it comes up blank it suggests that it's probably part of the application source that you are trying to compile.
Thank you!
I did find the following pixbufloader.h files in my system, but I don't know how to configure Anjuta to look for the correct directory while compiling? (Since these files are in the gtkmm directories instead of gdk!)

Please advise,
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	228
Size:	169.6 KB
ID:	3359  
Reply With Quote
Reply

Tags
newbie, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
linux programming vs. windows programming unlovedwarrior Programming & Packaging 11 22nd October 2006 09:14 PM
C Programming jai Using Fedora 12 8th March 2006 02:23 AM
Programming in C++ cederstrom Programming & Packaging 3 10th August 2005 07:44 AM
ASP programming vbmark Using Fedora 6 7th July 2005 05:30 AM


Current GMT-time: 04:11 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat