Getting “gtk_settings_get_for_screen: assertion ‘GDK_IS_SCREEN (screen)’ failed” when running GTKmm program

I try to run program uses GTKmm library on Lubuntu 16.04 over x11vnc. When I start it in terminal, it throws to errors:

(process:6981): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed

(process:6981): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed
Segmentation fault (core dumped)

I tried debugging the code, but the segmentation fault occurs before the first line of main function.