sprinfall / webcc

Lightweight C++ HTTP client and server library based on Asio for embedding purpose.
GNU Lesser General Public License v3.0
270 stars 61 forks source link

error: ‘webcc::HttpStatus’ has not been declared #6

Closed umarmir closed 5 years ago

umarmir commented 5 years ago

Can some one give any idea? while doing CMake getting this.

In member function ‘virtual void ConfigServerDefault::Get(const webcc::UrlQuery&, webcc::RestResponse*)’: /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:19:35: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kOK; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp: In member function ‘virtual void ConfigServerResponse::Get(const UrlSubMatches&, const webcc::UrlQuery&, webcc::RestResponse*)’: /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:31:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kBadRequest; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:43:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kNotFound; ^ /home/afinitiapp/caravan/poc/src/config_server/cs_daemon/ConfigServerRestAPI.cpp:47:39: error: ‘webcc::HttpStatus’ has not been declared response->status = webcc::HttpStatus::kOK;

umarmir commented 5 years ago

Just switched back to an old commit and my issue resolved. I think issue is in latest code/commits.

git reset --hard 360d095

sprinfall commented 5 years ago

Hi, HTTP related definitions (including status codes, headers, media types, etc.) have been moved into a namespace called "http". See webcc/globals.h for more information.

Please also note that this library is far from being stable. Code changes cannot be avoided if I continue to develop it. Please stick to a commit if you are happy or periodically update to the latest code to take some risk.