jeremycw / httpserver.h

Single header library for writing non-blocking HTTP servers in C
MIT License
1.78k stars 143 forks source link

how to use in c++11 project? #41

Closed chanwoood closed 4 years ago

chanwoood commented 4 years ago

I use gcc version 4.8.5 with compile flag -W -Wall -Wfatal-errors -g -std=c99 -std=c++11, build error:

./deps/httpserver.h/jeremycw/httpserver.h: In function ‘void hs_init_session(http_request_t*)’:
./deps/httpserver.h/jeremycw/httpserver.h:1047:35: error: expected primary-expression before ‘)’ token
   session->parser = (http_parser_t){ };
                                   ^
compilation terminated due to -Wfatal-errors. 
FightingBoom commented 3 years ago

How do you solve this problem? thank you

FightingBoom commented 3 years ago

I used make clean, but this problem occurred again error: unknown type name 'clockid_t' extern int timerfd_create (clockid_t __clock_id, int __flags) __THROW; ^