question about error on compile
- From: Vasiliy Tolstov <v tolstov selfip ru>
- To: gtk-list <gtk-list gnome org>
- Subject: question about error on compile
- Date: Mon, 15 Sep 2008 11:17:49 +0400
I'm try to compile my program and get this error
mv -f .deps/usp_client-plugin.Tpo .deps/usp_client-plugin.Po
/bin/sh ../../libtool --tag=CXX --mode=link g++
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/libpng12 -I/usr/include/pixman-1 -I../common
-I../../include -g -O2 -o usp-client usp_client-client.o
usp_client-window.o usp_client-main.o usp_client-config.o
usp_client-logger.o usp_client-pluginloader.o usp_client-common.o
usp_client-message.o usp_client-modules.o usp_client-plugin.o -lssl
-ldl -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm
-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl
-lglib-2.0
mkdir .libs
g++ -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1
-I../common -I../../include -g -O2 -o usp-client usp_client-client.o
usp_client-window.o usp_client-main.o usp_client-config.o
usp_client-logger.o usp_client-pluginloader.o usp_client-common.o
usp_client-message.o usp_client-modules.o usp_client-plugin.o
-lssl /usr/lib/libgtk-x11-2.0.so /usr/lib/libgdk-x11-2.0.so /usr/lib/libatk-1.0.so /usr/lib/libgdk_pixbuf-2.0.so -lm /usr/lib/libpangocairo-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libcairo.so /usr/lib/libgobject-2.0.so /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so
usp_client-window.o: In function `MainWindow':
/home/vase/usp/src/client/window.cc:36: undefined reference to `vtable
for MainWindow'
/home/vase/usp/src/client/window.cc:36: undefined reference to `vtable
for MainWindow'
where is mistake?
window.cc:
#include <iostream>
#include "window.h"
enum
{
COL_DISPLAY_NAME,
COL_PIXBUF,
NUM_COLS
};
GtkTreeModel * MainWindow::init_model (void)
{
GtkListStore *list_store;
GdkPixbuf *p1;
GtkTreeIter iter;
// GError *err;
p1 = gdk_pixbuf_new_from_file_at_size
("/usr/share/pixmaps/faces/penguin.jpg", 42, 42, NULL);
list_store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING,
GDK_TYPE_PIXBUF);
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter, COL_DISPLAY_NAME,
"services", COL_PIXBUF, p1, -1);
return GTK_TREE_MODEL (list_store);
}
MainWindow::MainWindow(int argc,char **argv){
gtk_init (&argc,&argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Panel Client");
gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_set_size_request (window, 800, 600);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), sw);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
icon_view = gtk_icon_view_new_with_model (init_model ());
gtk_container_add (GTK_CONTAINER (sw), icon_view);
gtk_icon_view_set_text_column (GTK_ICON_VIEW (icon_view),
COL_DISPLAY_NAME);
gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icon_view),
COL_PIXBUF);
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
GTK_SELECTION_MULTIPLE);
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit),
NULL);
// g_signal_connect (icon_view, "item-activated", G_CALLBACK
(send_msg), NULL);
gtk_widget_show_all (window);
gtk_main ();
}
window.h:
#include <string>
#include <iostream>
#include <gtk/gtk.h>
#include "logger.h"
#ifndef __MAINWINDOW_H__
#define __MAINWINDOW_H__
class MainWindow {
private:
protected:
private:
GtkWidget *window;
GtkWidget *icon_view;
GtkWidget *sw;
public:
MainWindow(int argc,char **argv);
virtual ~MainWindow();
GtkTreeModel * init_model (void);
};
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]