Author Topic: Problem using GTK 3  (Read 2950 times)

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Problem using GTK 3
« on: August 14, 2017, 08:48:16 am »
Hi,

Based on some Internet material I succeeded to compile using GTK 3:

hello.c

Code
#include <gtk/gtk.h>

int main( int argc, char **argv)
{
GtkWidget *window;

gtk_init(&argc, &argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);

gtk_main();

return 0;
}

I tried:

Code
gcc -o hello hello.c `pkg-config --libs --cflags gtk+-3.0`

Code
clang -o hello2 hello.c `pkg-config --libs --cflags gtk+-3.0`

Both compiles worked.

But following the link, I got hundreds of warnings and a few errors:

https://stackoverflow.com/questions/5921460/how-to-setup-gtk-to-develop-with-codeblocks-on-ubuntu-linux

What can I do?
Code::Blocks SVN
OS : Ubuntu LTS

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Problem using GTK 3
« Reply #1 on: August 14, 2017, 10:52:13 am »
Are you talking about gtk asserts printed at runtime?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ordak

  • Multiple posting newcomer
  • *
  • Posts: 105
    • My Site
Re: Problem using GTK 3
« Reply #2 on: August 14, 2017, 11:03:16 am »
Are you talking about gtk asserts printed at runtime?

No, sorry. I used a "User template" for console projects. After using the correct new GTK+ project and following the link in my first post, I was able to compile the codes.
Code::Blocks SVN
OS : Ubuntu LTS