Skip to content
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

test_gw does not compile #11

Open
p91paul opened this issue Aug 30, 2018 · 0 comments
Open

test_gw does not compile #11

p91paul opened this issue Aug 30, 2018 · 0 comments

Comments

@p91paul
Copy link

p91paul commented Aug 30, 2018

Running make test_gw (as well as just make) leads to compile errors.

Some errors are easy (patch below), but I got stuck on this one:

$ make test_gw
Scanning dependencies of target test_gw
Building CXX object tests/d/CMakeFiles/test_gw.dir/test_gw.cpp.o
/home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp: In function ‘int main(int, char**)’:
/home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp:128:2: error: ‘InOut0’ was not declared in this scope
  InOut0 n0(name1,address1,name2,address2,&transport);
  ^~~~~~
/home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp:128:2: note: suggested alternative: ‘InOut1’
  InOut0 n0(name1,address1,name2,address2,&transport);
  ^~~~~~
  InOut1
/home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp:129:2: error: ‘n0’ was not declared in this scope
  n0.skipfirstpop(true);
  ^~
In file included from /home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp:16:
/home/paolo/Programmazione/fastflow/ff/dnode.hpp: In instantiation of ‘int ff::ff_dinout<CommImplIn, CommImplOut>::initOut(const string&, const string&, int, typename CommImplOut::TransportImpl*, int, ff::dnode_cbk_t) [with CommImplIn = ff::zmqOnDemand; CommImplOut = ff::zmqFromAny; std::__cxx11::string = std::__cxx11::basic_string<char>; typename CommImplOut::TransportImpl = ff::zmqTransport; ff::dnode_cbk_t = void (*)(void*, void*)]’:
/home/paolo/Programmazione/fastflow/tests/d/test_gw.cpp:52:26:   required from here
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:535:41: error: ‘bool ff::ff_dnode<ff::zmqFromAny>::skipdnode’ is protected within this context
         ff_dnode<CommImplOut>::skipdnode=false;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:433:14: note: declared protected here
     bool     skipdnode;
              ^~~~~~~~~
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:535:41: error: invalid use of non-static data member ‘ff::ff_dnode<ff::zmqFromAny>::skipdnode’
         ff_dnode<CommImplOut>::skipdnode=false;
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:433:14: note: declared here
     bool     skipdnode;
              ^~~~~~~~~
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:536:34: error: ‘void (* ff::ff_dnode<ff::zmqFromAny>::cb)(void*, void*)’ is protected within this context
         ff_dnode<CommImplOut>::cb=cbk;
         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/paolo/Programmazione/fastflow/ff/dnode.hpp:440:13: note: declared protected here
 dnode_cbk_t ff_dnode<CommImpl>::cb=0;
             ^~~~~~~~~~~~~~~~~~
make[3]: *** [tests/d/CMakeFiles/test_gw.dir/build.make:63: tests/d/CMakeFiles/test_gw.dir/test_gw.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:8024: tests/d/CMakeFiles/test_gw.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:8036: tests/d/CMakeFiles/test_gw.dir/rule] Error 2
make: *** [Makefile:2801: test_gw] Error 2

Patch for trivial issues:

diff --git a/tests/d/test_gw.cpp b/tests/d/test_gw.cpp
index 7d1b6ba..256a2de 100644
--- a/tests/d/test_gw.cpp
+++ b/tests/d/test_gw.cpp
@@ -11,6 +11,7 @@
  *
  */
 
+#include <iostream>
 #include <ff/node.hpp>
 #include <ff/dnode.hpp>
 #include <ff/d/inter.hpp>
@@ -53,7 +54,7 @@ public:
        return 0;
     }
     // TODO: increase/decrease granularity at run-time
-    void * svc(void *task) { return task);
+    void * svc(void *task) { return task; };
     
 protected:
     const std::string name1;
@@ -96,7 +97,7 @@ public:
        printf("InOut1 ending\n");
     }
 
-    virtual FFBUFFER * const get_out_buffer() const { return (FFBUFFER*)1;}
+    virtual FFBUFFER * get_out_buffer() const { return (FFBUFFER*)1;}
 
 protected:
     const std::string name1;

Compiler version:

g++ (Debian 8.2.0-4) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant