After not being able to use ImportC to automatically compile a C library, now I'm trying to do it myself. The library I want to use is tomlc99 which is a small C library to parse toml files. Now I compiled the library and I copied the "config.h" file and modified to make it a D file that will contain the declaration so D knows which symbols to call. I resulted with a "toml.d" file and a "main.d" file. The first one contains the decorations and the second one contains the code from the example in the usage section. However, when I try to compile, I'm getting the following error message:
main.d(51): Error: need `this` for `s` of type `char*`
Deprecation: argument `__error` for format specification `"%s"` must be `char*`, not `_error_`
main.d(57): Error: need `this` for `i` of type `long`
main.d(63): Error: need `this` for `s` of type `char*`
I uploaded the modified files so someone is able to look at them and explain me what I'm doing wrong so I can properly learn. Links: