-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unable to make on ubuntu 17.04 #19
Comments
"error: ‘map’ does not name a type" Do you have build essentials installed? Can you build https://github.com/protobuf-c/protobuf-c project and see if that goes through fine? |
@ajhai protobuf-c is already installed and able to do the example snippet compilation. i.e, |
I took a look and that is a legitimate error. That header file includes and declares a variable "variables_" of type map...which it should be std::map. So it's a legitimate bug IMO. Its possible for the developer that header includes somewhere in the chain have a "using namespace std;" in which case the map without std:: prefix would work...but that would be bad form. Dont use "using namespace ..." in headers (impl files are fine). Reason being that it imports the entire std:: namespace into global namespace, can then cause naming conflicts, it's affect is viral to all code that includes that evil header, and negates the whole reason for using namespaces. My suggestion would be to fork that project and fix up those issues by adding std:: to the front of map. Then send the original developer a pull request after you have it working. |
@guru-florida Thanks for looking into it. Like I said, the namespace issue keeps growing for other components like sets, queue and so on. So I thought I was missing something. So were you able to compile this in other environments? |
I found these are already addressed in the parent protobuf-c so updated the submodule by pulling from the master for the submodule. Now I am having this issue. @ajhai Anything that I missed here ?
|
@javapriyan Thanks for identifying protobuf-c updates. I will pull and update submodule. This all seems to be working fine in my vagrant which is Ubuntu 16.04. For the issues that you are seeing now, what is the version of gRPC you have installed? Latest master of grpc-c will work with gRPC v1.3.0 |
@ajhai It was 1.6 I guess. To be precise used this https://github.com/grpc/grpc/blob/v1.6.x/INSTALL.md Let me try downgrade this to 1.3 once. |
After degrading, I have got this error. I know I am making some noice here but would really love to get this up and running.
|
Looks like some issue with strndup definition. Other projects also seem to have hit similar issue. Can you check what is the generated value of HAVE_STRNDUP ? Can you paste your configure output? If you want to get it up and running quick, can you try this on a vagrant with 16.04? Use protobuf 3.0 and gRPCv1.3. I suspect the initial error could be because of running latest protobuf. What is the version of protobuf you have installed? |
I fixed the
|
@javapriyan Do you have solve the compile problem? How to solve? |
Having this error while making,
root@kumaran:~/grpc-c/build# make make all-recursive make[1]: Entering directory '/root/grpc-c/build' Making all in compiler make[2]: Entering directory '/root/grpc-c/build/compiler' depbase=
echo ../third_party/protobuf-c/protoc-c/c_bytes_field.o | sed 's|[^/]*$|.deps/&|;s|.o$||';\ g++ -DHAVE_CONFIG_H -I. -I../../compiler -I.. -I../../compiler -I../../compiler/../third_party/protobuf-c -I../../compiler/../third_party/protobuf-c/protobuf-c -g -O2 -MT ../third_party/protobuf-c/protoc-c/c_bytes_field.o -MD -MP -MF $depbase.Tpo -c -o ../third_party/protobuf-c/protoc-c/c_bytes_field.o ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc &&\ mv -f $depbase.Tpo $depbase.Po In file included from ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:63:0: ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.h:89:3: error: ‘map’ does not name a type map<string, string> variables_; ^~~ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:77:25: error: ‘map’ has not been declared map<string, string>* variables) { ^~~ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:77:28: error: expected ‘,’ or ‘...’ before ‘<’ token map<string, string>* variables) { ^ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc: In function ‘void google::protobuf::compiler::c::SetBytesVariables(const google::protobuf::FieldDescriptor*, int)’: ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:78:5: error: ‘variables’ was not declared in this scope (*variables)["name"] = FieldName(descriptor); ^~~~~~~~~ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc: In constructor ‘google::protobuf::compiler::c::BytesFieldGenerator::BytesFieldGenerator(const google::protobuf::FieldDescriptor*)’: ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:89:34: error: ‘variables_’ was not declared in this scope SetBytesVariables(descriptor, &variables_); ^~~~~~~~~~ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc: In member function ‘virtual void google::protobuf::compiler::c::BytesFieldGenerator::GenerateStructMembers(google::protobuf::io::Printer*) const’: ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:101:22: error: ‘variables_’ was not declared in this scope printer->Print(variables_, "ProtobufCBinaryData $name$$deprecated$;\n"); ^~~~~~~~~~ ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc: In member function ‘virtual void google::protobuf::compiler::c::BytesFieldGenerator::GenerateStaticInit(google::protobuf::io::Printer*) const’: ../../compiler/../third_party/protobuf-c/protoc-c/c_bytes_field.cc:142:22: error: ‘variables_’ was not declared in this scope printer->Print(variables_, "$default_value$"); ^~~~~~~~~~ Makefile:519: recipe for target '../third_party/protobuf-c/protoc-c/c_bytes_field.o' failed make[2]: *** [../third_party/protobuf-c/protoc-c/c_bytes_field.o] Error 1 make[2]: Leaving directory '/root/grpc-c/build/compiler' Makefile:464: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/root/grpc-c/build' Makefile:375: recipe for target 'all' failed make: *** [all] Error 2
And tried to resolve with this solution. The errors are repeated for other components like set and queue and so on. The same is reproducible for mint versions as well. I bet in other evn too.
The text was updated successfully, but these errors were encountered: