I believe this may be a difference in GTK+-2.0 and GTK+-3.0. I followed this tutorial and ended up with this error:
Code:
# gcc -Wall -g mnemonics.c -o mnemonics `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
mnemonics.c: In function ‘main':
mnemonics.c:44:61: error: ‘GDK_q' undeclared (first use in this function)
mnemonics.c:44:61: note: each undeclared identifier is reported only once for each function it appears in
I double-checked and I have all the correct header files installed in the correct locations.
Here is my code:
Code:
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
int main(int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *vbox;
GtkWidget *menubar;
GtkWidget *filemenu;
GtkWidget *file;
GtkWidget *new;
GtkWidget *open;
GtkWidget *quit;
GtkWidget *sep;
GtkAccelGroup *accel_group = NULL;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 250, 200);
gtk_window_set_title(GTK_WINDOW(window), "menu");
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), vbox);
// In this code we create a menubar and a menu.
menubar = gtk_menu_bar_new();
filemenu = gtk_menu_new();
accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
file = gtk_menu_item_new_with_mnemonic("_File");
new = gtk_image_menu_item_new_from_stock(GTK_STOCK_NEW, NULL);
open = gtk_image_menu_item_new_from_stock(GTK_STOCK_OPEN, NULL);
sep = gtk_separator_menu_item_new();
quit = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, accel_group);
gtk_widget_add_accelerator(quit, "activate", accel_group, GDK_q, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
// The code line below implements a file menu
gtk_menu_item_set_submenu(GTK_MENU_ITEM(file), filemenu);
// Here menu items are implemented
gtk_menu_shell_append(GTK_MENU_SHELL(filemenu), new);
gtk_menu_shell_append(GTK_MENU_SHELL(filemenu), open);
gtk_menu_shell_append(GTK_MENU_SHELL(filemenu), sep);
gtk_menu_shell_append(GTK_MENU_SHELL(filemenu), quit);
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), file);
gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 3);
g_signal_connect_swapped(G_OBJECT(window), "destroy",
G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(G_OBJECT(quit), "activate",
G_CALLBACK(gtk_main_quit), NULL);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
I had been using a modem installed on a Digi accelerator port to dial in to an SCO open server r5 server. On monday it quit working and I realy don't know how it was installed and configured. I have tested the modem on a PC and it works. The port the modem is connected to is ttyB06 and I have... (1 Reply)
Hi,
I have installed "Freetype2" library in my SuSe Linux 9.3 version system. When Iam compiling a program, I am getting these below errors.
Undefined reference to "FT_Init_FreeType"
Undefined reference to "FT_Load_Char"
Please show me a solution? Thank you.
With regards,
Chandramouli (1 Reply)
Hi All.
I have one problem.
I am writng client-server by using pipes. But when i compile i get following error.
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** Error 1
... (2 Replies)
Hi,
I installed DirectFb on fedora 7, the machine has a Nvidia graphics card. The installation was successful and I can play the examples provided by the Direct fb website, but, I find that the accelarator is not getting recognised. when I do "fbset -i", the details shown are as below, it gives... (0 Replies)
I am using gcc to compile c objects on solaris 5.10 and hit the following error messages:
/usr/include/sys/vfs.h:323: error: syntax error before "statvfs64_t"
/usr/include/sys/vfs.h:334: error: syntax error before "statvfs64_t"
gmake: *** Error 1
The c program files were copied over from... (3 Replies)
Hi,
I am using Ubuntu 10.04. Recently I have seen this error appear in my terminal as I edit text files with gedit:
(gedit:2841): Gtk-CRITICAL **: gtk_widget_is_ancestor: assertion `ancestor != NULL' failed
Any ideas on what this means?
Mike (1 Reply)
Hi guys i came across an error while compiling a c file in solaris using gcc. the error is,
Undefined first referenced
symbol in file
bind /var/tmp//ccAr8qAh.o
accept ... (4 Replies)
Hi
I am trying to compile a binary file (CASPER: Context-Aware Scheme for Paired-End Read) but I am getting the following error:
user@user-OptiPlex-780 make
g++ -O2 -Wall -fopenmp -c -o merge.o merge.c
merge.c:8:35: fatal error: boost/unordered_map.hpp: No such... (2 Replies)