c++ - gdk (gtk3) in codeblocks on windows 7 -


i have configured gtk3+ (i've changed gtk2+ gtk3+) in codeblocks 13.2 on windows 7, , created new gtk+ (exmaple) project. example projcet compiled , works properly.

next included gdk:

#include <gdk/gdk.h> 

but when added lines:

gdk_init(&argc, &argv);  gdkscreen *screen = gdk_screen_get_default();` 

i got 2 errors:

undefined referrence 'gdk_init' and
undefined referrence 'gdk_screen_get_default'

where problem? i'm looking concrete solution.

compilation log:

||=== build: debug in gtk4test (compiler: gnu gcc compiler) ===| c:\myp\gtk4test\main.c||in function 'main':| c:\myp\gtk4test\main.c|37|warning: 'gtk_vbox_new' deprecated (declared @ c:\gtk\include\gtk-3.0/gtk/deprecated/gtkvbox.h:60): use 'gtk_box_new' instead [-wdeprecated-declarations]| c:\myp\gtk4test\main.c|53|warning: unused variable 'screen' [-wunused-variable]| obj\debug\main.o||in function `main':| c:\myp\gtk4test\main.c|52|undefined reference `gdk_init'| c:\myp\gtk4test\main.c|53|undefined reference `gdk_screen_get_default'| ||=== build failed: 2 error(s), 2 warning(s) (0 minute(s), 0 second(s)) ===| 

if have called gtk_init, shouldn't call gdk_init (as gtk_init calls it). generally, should call gdk functions.

if need gdk_init() reason, have add

gcc ... `pkg-config --libs --cflags  gdk-3.0` ... 

to compilation line. note have reconfigure ide use gdk3 instead of gdk2.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -