ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.36k stars 2.8k forks source link

gtk library not found #1608

Closed BigfootN closed 8 years ago

BigfootN commented 8 years ago

Hello,

I currently need the gtk library, but ycm doesn't seem to have found the library, not even the header gtk/gtk.h.

I've tried with a simple file :

#include <gtk/gtk.h>

static void
activate (GtkApplication* app)
{
    GtkWidget* window;

    window = gtk_application_window_new (app);
    gtk_window_set_title (GTK_WINDOW (window), "Window");
    gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
    gtk_widget_show_all (window);
}

int main (int    argc,
          char** argv)
{
    GtkApplication* app;
    int status;

    app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
    g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
    status = g_application_run (G_APPLICATION (app), argc, argv);
    g_object_unref (app);

    return status;
}

Here are my ycm options:

let g:ycm_show_diagnostics_ui = 0
let g:ycm_add_preview_to_completeopt = 1
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_confirm_extra_conf = 0

The flags I used for the ycm config file :

'-Wall',
'-Wextra',
'-Werror',
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
# source code needs it.
'-DUSE_CLANG_COMPLETER',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c89',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c',
'-I/usr/include/gtk-3.0',
'-I/usr/include/at-spi2-atk/2.0',
'-I/usr/include/at-spi2-2.0',
'-I/usr/include/dbus-1.0',
'-I/usr/include/dbus-1.0/include',
'-I/usr/include/gio-unix-2.0',
'-I/usr/include/cairo',
'-I/usr/include/pango-1.0',
'-I/usr/include/atk-1.0',
'-I/usr/include/pixman-1',
'-I/usr/include/freetype2',
'-I/usr/include/libpng16',
'-I/usr/include/harfbuzz',
'-I/usr/include/libdrm',
'-I/usr/include/gdk-pixbuf-2.0',
'-I/usr/include/glib-2.0',
'-I/usr/include/glib-2.0/include',
'-I/usr/lib/glib-2.0/include',

Here is the return of YcmDiags:

popup.c|1 col 10 error| 'gtk/gtk.h' file not found
popup.c|4 col 11 error| unknown type name 'GtkApplication'
popup.c|6 col 5 error| use of undeclared identifier 'GtkWidget'
popup.c|6 col 16 error| use of undeclared identifier 'window'
popup.c|8 col 5 error| use of undeclared identifier 'window'
popup.c|8 col 14 error| implicit declaration of function 'gtk_application_window_new'
popup.c|9 col 5 error| implicit declaration of function 'gtk_window_set_title'
popup.c|9 col 27 error| implicit declaration of function 'GTK_WINDOW'
popup.c|9 col 39 error| use of undeclared identifier 'window'
popup.c|10 col 5 error| implicit declaration of function 'gtk_window_set_default_size'
popup.c|10 col 46 error| use of undeclared identifier 'window'
popup.c|11 col 5 error| implicit declaration of function 'gtk_widget_show_all'
popup.c|11 col 26 error| use of undeclared identifier 'window'
popup.c|18 col 5 error| use of undeclared identifier 'GtkApplication'
popup.c|18 col 21 error| use of undeclared identifier 'app'
popup.c|21 col 5 error| use of undeclared identifier 'app'
popup.c|21 col 11 error| implicit declaration of function 'gtk_application_new'
popup.c|21 col 51 error| use of undeclared identifier 'G_APPLICATION_FLAGS_NONE'
popup.c|22 col 5 error| implicit declaration of function 'g_signal_connect'
popup.c|22 col 23 error| use of undeclared identifier 'app'

Here is the return of YcmDebugInfo:

Printing YouCompleteMe debug information...
-- Server has Clang support compiled in: True
-- Clang version: clang version 3.6.0 (tags/RELEASE_360/final)
-- Flags for /home/scriptor/Documents/Prog/popup/popup.c loaded from /home/scriptor/Documents/Prog/popup/.ycm_extra_conf.py:
-- ['-Wall', '-Wextra', '-Werror', '-DUSE_CLANG_COMPLETER', '--std=c89', '-x', 'c', '-isystem', '/home/scriptor/Documents/Prog/popup/../BoostParts', '-isystem', '-I/usr/include/gtk-3.0', '-I/usr/include/at-spi2-atk/2.0', '-I/usr/include/at-spi2-2.0', '-I/usr/include/dbus-1.0', '-I/usr/include/dbus-1.0/include', '-I/usr/include/gio-unix-2.0', '-I/usr/include/cairo', '-I/usr/include/pango-1.0', '-I/usr/include/atk-1.0', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng16', '-I/usr/include/harfbuzz', '-I/usr/include/libdrm', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/glib-2.0', '-I/usr/include/glib-2.0/include', '-I/usr/lib/glib-2.0/include', '-isystem', '/home/scriptor/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../clang_includes']
-- Server running at: http://127.0.0.1:45390
-- Server process ID: 4726
-- Server logfiles:
--   /tmp/ycm_temp/server_45390_stdout.log
--   /tmp/ycm_temp/server_45390_stderr.log

Here is return of vim --version :

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 11 2015 08:45:35)
Rustines incluses : 1-778
Compilé par Arch Linux
Énorme version avec interface graphique GTK2.
  Fonctionnalités incluses (+) ou non (-) :
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           +mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  +lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            +mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
         fichier vimrc système : "/etc/vimrc"
     fichier vimrc utilisateur : "$HOME/.vimrc"
 2me fichier vimrc utilisateur : "~/.vim/vimrc"
      fichier exrc utilisateur : "$HOME/.exrc"
        fichier gvimrc système : "/etc/gvimrc"
    fichier gvimrc utilisateur : "$HOME/.gvimrc"
2me fichier gvimrc utilisateur : "~/.vim/gvimrc"
          fichier menu système : "$VIMRUNTIME/menu.vim"
               $VIM par défaut : "/usr/share/vim"
Compilation : gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz  -D_FORTIFY_SOURCE=2  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Édition de liens : gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype  -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -lncurses -lelf -lnsl   -lacl -lattr -lgpm -ldl  -L/usr/lib -llua -Wl,-E -Wl,-rpath,/usr/lib/perl5/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic   -lruby -lpthread -lgmp -ldl -lcrypt -lm  -L/usr/lib

Thank you very much in advance and do hesitate to ask for any further information :)

BigfootN commented 8 years ago

So, I am really sorry, I'm not really sure what I did, but just by restarting vim it seems to have fixed the problem.