Jump to content
Sign in to follow this  
AccessD

Как создать окно-сообщение с помощью GTK?

Recommended Posts

В чем проблема не могу понять?

#include<gtk/gtk.h>

typedef enum

{

GTK_MESSAGE_ERROR

} GtkMessageType;

typedef enum

{

GTK_BUTTONS_CLOSE

} GtkButtonsType;

typedef enum

{

GTK_DIALOG_DESTROY_WITH_PARENT

}GtkDialogFlags;

int main (int argc, char **argv)

{

GtkWidget *dialog;

GtkWidget *window;

dialog=gtk_message_dialog_new(GTK_WINDOW(window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "ERROR LOADING FILE");

gtk_dialog_run(GTK_DIALOG(dialog));

gtk_widget_destroy(dialog);

return 0;

}

[root@localhost ~]# gcc -Wall -g mess.c -o mess `gtk-config --cflags --libs`

mess.c: In function `main':

mess.c:18: warning: implicit declaration of function `gtk_message_dialog_new'

mess.c:18: warning: assignment makes pointer from integer without a cast

mess.c:19: warning: implicit declaration of function `gtk_dialog_run'

mess.c:22:2: warning: no newline at end of file

/tmp/ccC6cZNL.o(.text+0x3a): In function `main':

/root/mess.c:18: undefined reference to `gtk_message_dialog_new'

/tmp/ccC6cZNL.o(.text+0x63):/root/mess.c:19: undefined reference to `gtk_dialog_run'

collect2: ld returned 1 exit status

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...