'Ctags Can't tag SDL/SDL2 functions
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
So, How to solve this?
Solution 1:[1]
seems the command
ctags -R --c++-kinds=+p --fields=+iaS --extras=+q .
running in /usr/include/ folder fixed the issue.
Solution 2:[2]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Noman |
| Solution 2 | Masatake YAMATO |
