tags:

views:

67

answers:

1

I have installed omnicppcomplete, taglist, cscope, etc., and I generated my tags in /usr/include using:

ctags -R --c++-kinds=+plx --fields=+iaS --extra=+q .

And in my .vimrc I set:

set tags=/usr/include/tags,./tags,./..tags,./**/tags

But now when I write my multi-thread programs, I can not switch to pthread_create and pthread_mutex_init by pressing Ctrl+]. It says "tags not found".

So I am writing here for help. Thanks.

A: 

You should look in your tags file to determine if pthread_mutex_init and pthread_create are actually in them. If they are not then it is likely that either (1) the source wasn't scanned or (2) they don't actually exist in the form you expect. Both pthread_create and pthread_mutex_init are contained in libc, which is a very complex set of code, and often you will find that a symbol is defined in a indirect way through multiple layers of pre-processor macros, in which case ctags won't work.

Noah Watkins
i searched the tags file in /usr/include, finding the following line__pthread_mutex_init bits/libc-lock.h /*extern int __pthread_mutex_init(.........)*/it is just like what you said. and pthread.h indeed includes many pre-processor macros.so is there any method to let ctags know these tags?PS, i notice that when i typing and pressing ctrl+n to do word completion, it can successfully parse the pthread_create and pthread_mutex_init function
Good question. What is in your file: `/usr/include/pthread.h`. On my Mac the full `pthread_create` declaration is there, so ostensibly this would all work here. Check `pthread.h` for `pthread_create`. If it is in there like you expect, then I think that the file isn't getting parsed.
Noah Watkins
i have checked the /usr/include/pthread.h, i also have the full pthread_create declaration there in my Fedora 13. but i notice another problem, it can parse pthread_join, but can not pasrse pthread_create. so i am sure the file is parsed but it seems that it doesn't parse all of them, do i need some other configuration?
can you successfully parse pthread_create on your mac?
Hrmm...Exubertant ctags won't extract pthread_create on my mac either. I'll look at this a little more tonight.
Noah Watkins
thanks for your time, i am also looking into it