abique / hefur

Standalone C++ BitTorrent tracker
MIT License
192 stars 30 forks source link

failure to compile on Ubuntu 14.04 (minimal) #9

Closed eamonne closed 9 years ago

eamonne commented 9 years ago

Hello, I was unable to compile this using Ubuntu 14.04. I received the following errors:

    In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh: In member function ‘virtual bool hefur::AnnounceHandler::handle(mimosa::http::RequestReade
r&, mimosa::http::ResponseWriter&) const’:
/root/hefur/mimosa/mimosa/http/response.hh:93:21: error: ‘mimosa::http::Coding mimosa::http::Response::content_encoding_’ is protected
       Coding        content_encoding_;

 ^
/root/hefur/hefur/announce-handler.cc:18:14: error: within this context
     response.content_encoding_ = mh::kCodingIdentity;
  ^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:92:21: error: ‘bool mimosa::http::Response::keep_alive_’ is protected
       bool          keep_alive_;
                     ^
/root/hefur/hefur/announce-handler.cc:70:14: error: within this context
     response.keep_alive_   = false;

              ^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:96:21: error: ‘std::string mimosa::http::Response::content_type_’ is protected
       std::string   content_type_;
                     ^
/root/hefur/hefur/announce-handler.cc:71:14: error: within this context
     response.content_type_ = "text/plain";
              ^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:91:21: error: ‘int mimosa::http::Response::status_’ is protected
       int           status_;
                     ^
/root/hefur/hefur/announce-handler.cc:81:16: error: within this context
       response.status_ = mh::kStatusServiceUnavailable;
                ^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:95:21: error: ‘int64_t mimosa::http::Response::content_length_’ is protected
       int64_t       content_length_; ///< -1: auto
                     ^
/root/hefur/hefur/announce-handler.cc:97:16: error: within this context
       response.content_length_ = buf->str().size();
                ^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
                 from /root/hefur/mimosa/mimosa/http/handler.hh:7,
                 from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
                 from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:95:21: error: ‘int64_t mimosa::http::Response::content_length_’ is protected
       int64_t       content_length_; ///< -1: auto
                     ^
/root/hefur/hefur/announce-handler.cc:143:14: error: within this context
     response.content_length_ = buf->str().size();
              ^
make[2]: *** [hefur/CMakeFiles/hefurd.dir/announce-handler.cc.o] Error 1
make[1]: *** [hefur/CMakeFiles/hefurd.dir/all] Error 2
make: *** [all] Error 2

Any idea what would cause this? I'm using the latest protobuf and g++ 4.8. I was able to make sense of the earlier errors which were mainly relted to missing libraries, but this one has me stumped.

Alternately is there a better OS to choose for compiling?

Thanks

eamonne commented 9 years ago

Also I used this branch of mimosa as Hefur repository suggests that specific one.

https://github.com/abique/mimosa/tree/5e2c5c6ca998add2d5cdc9e437f8d13fbdbe1a7c

Should I stick with that version or use the latest?

abique commented 9 years ago

Hi JesseJams,

I tried to compile it on Archlinux and I succeed without any issue.

Anyway I did update the mimosa submodule to the latest version and update hefur accordingly. It built with both gcc 4.9.2 and clang 3.6.0.

Please, can you try again?

Regards, Alex

eamonne commented 9 years ago

Hello Alex,

Ok I've got it to compile without error on Ubuntu 14.04 (not minimal) I guess there were a few missing elements in the openvz ubuntu template I was using before.

The only error I received was that it was expecting manual.html in /manual but there was only manual.xml, changing that extension fixed it.

It also compiled without any issue (aside from manual.xml) on CentOS 7.

Regards, Jesse

lcharles123 commented 9 years ago

Hello! I got a error too:

$ make [ 1%] Building CXX object mimosa/mimosa/rpc/gen/CMakeFiles/protoc-gen-mimosa.dir/protoc-gen-mimosa.cc.o /home/charles/Desktop/hefur-0.4/mimosa/mimosa/rpc/gen/protoc-gen-mimosa.cc:6:53: fatal error: google/protobuf/compiler/code_generator.h: No such file or directory

include <google/protobuf/compiler/code_generator.h>

                                                 ^

compilation terminated. make[2]: * [mimosa/mimosa/rpc/gen/CMakeFiles/protoc-gen-mimosa.dir/protoc-gen-mimosa.cc.o] Error 1 make[1]: * [mimosa/mimosa/rpc/gen/CMakeFiles/protoc-gen-mimosa.dir/all] Error 2 make: *\ [all] Error 2

I use linux mint, what could be wrong?

lcharles123 commented 9 years ago

OK, my problem is solved by isntaling libprotoc-dev package. EDIT: this resolve all problems, thanks! https://github.com/abique/hefur/issues/7#issuecomment-42068479

abique commented 9 years ago

Yes ;-)