Open noeldum opened 3 years ago
I landed here and gave it a try with the example provided. First it complained of many include missing. I had to add these below to parser.h
#include <cstdio> #include <cstddef> #include <cstdlib> #include <cstring>
Does it makes sense?
Now I am stuck with the compilation error below.
In file included from config_reader.cpp:1: parser.h: In function ‘config_option* read_config_file(char*)’: parser.h:29:25: error: invalid conversion from ‘void*’ to ‘config_option_t’ {aka ‘config_option*’} [-fpermissive] 29 | if ((co = calloc(1, sizeof(config_option))) == NULL) | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void* config_reader.cpp: At global scope: config_reader.cpp:4:5: error: expected unqualified-id before ‘if’ 4 | if ((co = read_config_file("./001.conf")) == NULL) { | ^~ config_reader.cpp:8:5: error: expected unqualified-id before ‘while’ 8 | while(1) { | ^~~~~
You seem to try to use the c++ compiler, but this code is pure c. it is a good idea to add all include that a header needs.
I landed here and gave it a try with the example provided. First it complained of many include missing. I had to add these below to parser.h
Does it makes sense?
Now I am stuck with the compilation error below.