Git Product home page Git Product logo

Comments (11)

ajhai avatar ajhai commented on August 20, 2024

"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?

from grpc-c.

javapriyan avatar javapriyan commented on August 20, 2024

@ajhai protobuf-c is already installed and able to do the example snippet compilation. i.e, protoc --c_out=. example.proto What I am trying to achieve is building a c based server stram application.

from grpc-c.

guru-florida avatar guru-florida commented on August 20, 2024

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.

from grpc-c.

javapriyan avatar javapriyan commented on August 20, 2024

@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?

from grpc-c.

javapriyan avatar javapriyan commented on August 20, 2024

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 ?

make all-recursive make[1]: Entering directory '/home/kumaran/grpc-c/build' Making all in compiler make[2]: Entering directory '/home/kumaran/grpc-c/build/compiler' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/kumaran/grpc-c/build/compiler' Making all in lib make[2]: Entering directory '/home/kumaran/grpc-c/build/lib' depbase=`echo client.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I../../lib -I../../lib/h -I../../lib/../third_party/protobuf-c -g -O2 -MT client.lo -MD -MP -MF $depbase.Tpo -c -o client.lo ../../lib/client.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. -I../../lib -I../../lib/h -I../../lib/../third_party/protobuf-c -g -O2 -MT client.lo -MD -MP -MF .deps/client.Tpo -c ../../lib/client.c -fPIC -DPIC -o .libs/client.o ../../lib/client.c: In function ‘gc_client_create_by_host’: ../../lib/client.c:82:43: error: too few arguments to function ‘grpc_completion_queue_create’ client->gcc_channel_connectivity_cq = grpc_completion_queue_create(NULL); ^ In file included from ../../lib/h/grpc-c/grpc-c.h:14:0, from ../../lib/client.c:6: /usr/local/include/grpc/grpc.h:98:32: note: declared here GRPCAPI grpc_completion_queue *grpc_completion_queue_create( ^ ../../lib/client.c: In function ‘gc_client_prepare_async_ops’: ../../lib/client.c:579:23: error: too few arguments to function ‘grpc_completion_queue_create’ context->gcc_cq = grpc_completion_queue_create(NULL); ^ In file included from ../../lib/h/grpc-c/grpc-c.h:14:0, from ../../lib/client.c:6: /usr/local/include/grpc/grpc.h:98:32: note: declared here GRPCAPI grpc_completion_queue *grpc_completion_queue_create( ^ ../../lib/client.c: In function ‘gc_client_prepare_sync_ops’: ../../lib/client.c:744:23: error: too few arguments to function ‘grpc_completion_queue_create’ context->gcc_cq = grpc_completion_queue_create(NULL); ^ In file included from ../../lib/h/grpc-c/grpc-c.h:14:0, from ../../lib/client.c:6: /usr/local/include/grpc/grpc.h:98:32: note: declared here GRPCAPI grpc_completion_queue *grpc_completion_queue_create( ^ ../../lib/client.c: In function ‘gc_client_prepare_unary_ops’: ../../lib/client.c:874:23: error: too few arguments to function ‘grpc_completion_queue_create’ context->gcc_cq = grpc_completion_queue_create(NULL); ^ In file included from ../../lib/h/grpc-c/grpc-c.h:14:0, from ../../lib/client.c:6: /usr/local/include/grpc/grpc.h:98:32: note: declared here GRPCAPI grpc_completion_queue *grpc_completion_queue_create( ^ Makefile:482: recipe for target 'client.lo' failed make[2]: *** [client.lo] Error 1 make[2]: Leaving directory '/home/kumaran/grpc-c/build/lib' Makefile:464: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/kumaran/grpc-c/build' Makefile:375: recipe for target 'all' failed make: *** [all] Error 2

from grpc-c.

ajhai avatar ajhai commented on August 20, 2024

@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

from grpc-c.

javapriyan avatar javapriyan commented on August 20, 2024

@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.

from grpc-c.

javapriyan avatar javapriyan commented on August 20, 2024

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.

In file included from /usr/include/string.h:630:0, from ../../lib/common/strextra.h:16, from ../../lib/stream_ops.c:6: ../../lib/common/strextra.h:88:7: error: expected identifier or ‘(’ before ‘__extension__’ char *strndup (const char *str, size_t count); ^ Makefile:482: recipe for target 'stream_ops.lo' failed make[2]: *** [stream_ops.lo] Error 1 make[2]: Leaving directory '/home/kumaran/grpc-c/build/lib' Makefile:464: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/kumaran/grpc-c/build' Makefile:375: recipe for target 'all' failed make: *** [all] Error 2

from grpc-c.

ajhai avatar ajhai commented on August 20, 2024

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?

from grpc-c.

mattrichards avatar mattrichards commented on August 20, 2024

I fixed the error: expected identifier or ‘(’ before ‘__extension__’ error by #including "config.h" in lib/stream_ops.c.

--- a/lib/stream_ops.c
+++ b/lib/stream_ops.c
@@ -3,6 +3,7 @@
  * All rights reserved.
  */
 
+#include "config.h"
 #include "common/strextra.h"
 #include "stream_ops.h"

from grpc-c.

wxj520wzm avatar wxj520wzm commented on August 20, 2024

@javapriyan Do you have solve the compile problem? How to solve?

from grpc-c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.