0

I am tried to get to work GNU Globals in my Emacs, and found that it is couldn't find a function definitions. After a long searching I end up that GNU Globals itself just somehow broken for me, it doesn't index almost anything! Consider an example:

$ cat test.cpp 
class Foo {
public:
    int myint;
    short myshort;
    char mychar;
};

int main() {
    Foo obj;
    obj.myint = 0;
    return 0;
}
$ gtags
$ global Foo
test.cpp
$ global myint
$ global -r myint
$ global Foo::myint
$ global -r Foo::myint
$ cat GTAGS | grep myint

In the end I tried to grep «myint» and found that it isn't even present in GTAGS! The only place where it is mentioned is a GSYMS file. Of course, at first I tried the same code with a separate «.hpp» file, it didn't worked either.

UPDATE: I found that it is possible to create Global Tags with both of ctags and etags. For that it is need to issue export GTAGSLABEL=/usr/bin/etags (or to ctags), and launch gtags again. The variable works, it is easy to check by adding there a wrong path, so gtags would say about an error. So, I tried with my example the both backends, and neither worked.

Hi-Angel
  • 4,933
  • 8
  • 63
  • 86
  • 1
    You should use `global -s myint` in such case. – syohex Nov 17 '14 at 00:58
  • @syohex hm, indeed, `global -sx myint` showed me two locations one of which is the definition of the myint. Probably GNU Globlal for some reason do not recognizes a definition. – Hi-Angel Nov 17 '14 at 03:52

0 Answers0