c++ - http client in proxygen? -
hi using proxygen facebook create simple hhtpclient . trying run default httpclient example. using following command build it:
g++ -std=c++11 -o my_echo curlclient.o curlclientmain.o -lproxygenhttpserver -lfolly -lglog -lgflags -pthread
but getting following error:
curlclient.o: in function `curlservice::curlclient::connectsuccess(proxygen::httpupstreamsession*)': /home/kshitij/proxygen/httpclient/samples/curl/curlclient.cpp:69: undefined reference `proxygen::httpupstreamsession::newtransaction(proxygen::httptransactionhandler*)' curlclientmain.o: in function `main': /home/kshitij/proxygen/httpclient/samples/curl/curlclientmain.cpp:91: undefined reference `proxygen::httpconnector::httpconnector(proxygen::httpconnector::callback*, folly::hhwheeltimer*)' /home/kshitij/proxygen/httpclient/samples/curl/curlclientmain.cpp:102: undefined reference `proxygen::httpconnector::connect(folly::eventbase*, folly::socketaddress const&, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::map<folly::asyncsocket::optionkey, int, std::less<folly::asyncsocket::optionkey>, std::allocator<std::pair<folly::asyncsocket::optionkey const, int> > > const&, folly::socketaddress const&)' /home/kshitij/proxygen/httpclient/samples/curl/curlclientmain.cpp:91: undefined reference `proxygen::httpconnector::~httpconnector()' /home/kshitij/proxygen/httpclient/samples/curl/curlclientmain.cpp:99: undefined reference `proxygen::httpconnector::connectssl(folly::eventbase*, folly::socketaddress const&, std::shared_ptr<folly::sslcontext> const&, ssl_session_st*, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::map<folly::asyncsocket::optionkey, int, std::less<folly::asyncsocket::optionkey>, std::allocator<std::pair<folly::asyncsocket::optionkey const, int> > > const&, folly::socketaddress const&, std::string const&)' /home/kshitij/proxygen/httpclient/samples/curl/curlclientmain.cpp:91: undefined reference `proxygen::httpconnector::~httpconnector()' collect2: error: ld returned 1 exit status
what possible error. correct me if building wrong way.
g++ -std=c++11 -o my_echo curlclient.o curlclientmain.o httpupstreamsession.o -lproxygenhttpserver -lfolly -lglog -lgflags -pthread
the httpupstreamsession.h include referenced implementation defined in .cpp in same directory. need either build .cpp or use .o file in build.
Comments
Post a Comment