LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-20-2004, 11:55 PM   #1
sharma_deepak83
LQ Newbie
 
Registered: May 2004
Location: India
Distribution: Red Hat, mandrake, Fedora,Knoppix
Posts: 27

Rep: Reputation: 15
Strange errors when compiling GTK progs???


I am compiling the following GTK program and I getting very strange messages.

Pls help

// test2.c

#include <gtk/gtk.h>
static void delete_event(GtkWidget *widget , gpointer data)
{
gtk_main_quit();
}
int main(int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *button;
gtk_init(&argc , &argv);
window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_set_window_border_width(GTK_CONTAINER(window) , 10);
g_signal_connect(GTK_OBJECT(window) , "delete_event" , G_CALLBACK(delete_event), NULL);
button=gtk_new_button_with_label("GO GO");
gtk_container_add(GTK_CONTAINER(window) , button);
gtk_widget_show(button);
gtk_widget_show(window);
gtk_main();
return(0);
}
Command for compiling:: gcc test2.c -o test2 `pkg-config gtk+-2.0 --cflags --libs`

Errors

test2.c: In function `main':
test2.c:14: warning: assignment makes pointer from integer without a cast
/tmp/ccbSWpes.o(.text+0x61): In function `main':
: undefined reference to `gtk_set_window_border_width'
/tmp/ccbSWpes.o(.text+0xa7): In function `main':
: undefined reference to `gtk_new_button_with_label'


pls help fast....
 
Old 11-21-2004, 12:44 AM   #2
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
You should be using gtk_button_new_with_label NOT gtk_new_button_with_label. I can't find anything called gtk_set_window_border_width in the gtk API reference.

In general, if you use -Wall when compiling, the compiler will warn you about functions that aren't declared.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling opengl progs slackware 10.1 Beezer Slackware 2 08-09-2005 01:02 PM
The look of GTK progs in KDE (Suse) Zhenya Linux - Software 2 10-01-2004 08:22 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
compiling gaim/ gtk error (two versions of gtk) webazoid Linux - Software 0 07-06-2004 06:05 PM
Mozilla and strange GTk warning fenice1976 Linux - Software 0 05-17-2004 11:42 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration