Libclang: getting bad std::vector type

Hi,

I am using libclang to parse a header which has a function definition of the form:

std::vector<double> function1(double)

I am trying to get the return type by executing (starting from the cursor) :

clang_getCursorType → clang_getCursorResultType → clang_getCursorSpelling

but instead having a template declaration and I am getting just “int”.

in my program, this happens just with elements from std library, as other templates from within the same library are answered correctly.

How can this happen? I assume is more like a problem in my configuration, but I have no ides how to fix it :frowning:

Thanks in advance for any help.

I guess this is because system includes are not set correctly, so libclang can not find the definition of std::vector, for unknown type, it just returns int. try to use -I or other commands to convert your standard library path explicitly.

I can’t get it to work, I tried passing -I, -isystem, changing the order… nothing :frowning: