The C parser of Ghidra has various issues, e.g. it has a less extensive list of sane preprocessor variables and it just completely chokes on GCC attributes. I personally tried some approaches to make this work better, e.g. using the clang/gcc preprocessor to dump one giant header file, but they are still highly experimental and probably require a lot of tinkering, so I would overall just declare the C Parser as an nonviable approach for your problem.
The best way that I have heard of so far is to compile the library with full debug symbols in the version and target you need, then import that into Ghidra. Ghidra should then parse all the PDB/DWARF type information, create all the relevant types and apply the function signatures. Then you can link the library file to the binary you want to analyze in the first place, and propagate that information to it. I don't know a tutorial for that right now, but Ghidra has good support for such projects that involve multiple binaries. If you encounter any issues with that, those are most likely worth a separate dedicated question, because this is then the same process as propagating type information from a library that you had to reverse engineer too.
Edit:
I needed to do this recently and wrote it up as a small blogpost.
The general approach is like I described, but the blogpost itself isn't in a format and as polished as I'd like a StackExchange answer to be, so I don't think that copying it here would be appropriate.