yhirose/cpp-httplib

can't work with facebook/folly

weinberggithub opened this issue · 2 comments

I create a library (libmy) with cpp-httplib and there's an application(appmy) build on folly , when I trying to add libmy to appmy and there's some undefined reference link errors like :

/root/code/third_party/folly/folly/detail/MemoryIdler.cpp:195: undefined reference to 'google::ErrnoLogMessage::ErrnoLogMessage(char const*, int, int, long, void (google::LogMessage::*)())'

the dependencies glog had been linked, and I can't event just use httplib and folly run a httplib's example.
help please, It's been bother me for several days, thks.

example code:

#include "httplib.h"

#include<glog/logging.h>
#include<folly/json.h>
#include<folly/dynamic.h>
#include<iostream>
using namespace std;

int main(void) {

//google::InitGoogleLogging("/tmp/tmp.log");
//    PLOG_IF(WARNING,true) <<"test glog";

    std::string jsonDocument = R"({"key":12,"key2":[false, null, true, "yay"]})";
    folly::dynamic parsed = folly::parseJson(jsonDocument);
    assert(parsed["key"] == 12);
    assert(parsed["key2"][0] == false);
    assert(parsed["key2"][1] == nullptr);


    httplib::Server svr;

    svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) {
        res.set_content("Hello World!", "text/plain");
    });

}

@weinberggithub thanks for the feedback. But I am not to able to answer the question, since I don't know anything about folly and glog...