Ctags Can't tag SDL/SDL2 functions

138 views Asked by At

Using Ctag to jump to function decleration. Works fine for everything but not with SDL functions.

I used ctags -R . command to generate the tagfile in /usr/include/ file to generate tag file. And added set tags+=/usr/include/tags to .vimrc file so that vim can find and use it.

Which works fine for everything else and SDL struct and definde but can't find any function.

Like SDL2/SDL_render.h file there are a lot of struct and function but in the tag file there are only found the structure's and function's. see the ctag generated tag here

Screenshot

So, How to solve this?

2

There are 2 answers

0
Noman On BEST ANSWER

seems the command ctags -R --c++-kinds=+p --fields=+iaS --extras=+q . running in /usr/include/ folder fixed the issue.

0
Masatake YAMATO On

As Noman wrote, --c++-kinds=+p is needed. In addition, you may need to pass -I DECLSPEC -I SDLCALL

As far as reading https://raw.githubusercontent.com/LuaDist/sdl/master/include/SDL_render.h, macros that ctags doesn't know how to handle it are used in the header file. The options (-I) are the hints for ctags.