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

'error: 'is_proto_enum' was not declared in this scope' in protobuf/reflection.h #18

Open
companje opened this issue Feb 19, 2016 · 5 comments

Comments

@companje
Copy link

I'm trying to build Cura using cura-build on a fresh Ubuntu 15.04 Virtual Machine. It gets stuck on building libArcus with the following error.

In file included from /home/rick/dev/libArcus/python/PythonMessage.cpp:24:0:
/usr/include/google/protobuf/reflection.h:539:37: error: 'is_proto_enum' was not declared in this scope
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                  ^

more info:

rick@ubuntu:~/dev/libArcus/build$ cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PROTOBUF: /usr/lib/libprotobuf.so
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4.0")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.4m.so (found suitable version "3.4.3", minimum required is "3.4.0")
-- Found SIP version: 4.16.6
-- Configuring done
-- Generating done
-- Build files have been written to: /home/rick/dev/libArcus/build
rick@ubuntu:~/dev/libArcus/build$ make -j4
Scanning dependencies of target Arcus
[  5%] [ 10%] [ 21%] [ 21%] Building CXX object CMakeFiles/Arcus.dir/src/Socket.cpp.o
Building CXX object CMakeFiles/Arcus.dir/src/PlatformSocket.cpp.o
Building CXX object CMakeFiles/Arcus.dir/src/SocketListener.cpp.o
Building CXX object CMakeFiles/Arcus.dir/src/MessageTypeStore.cpp.o
[ 26%] Building CXX object CMakeFiles/Arcus.dir/src/Error.cpp.o
Linking CXX shared library libArcus.so
[ 26%] Built target Arcus
[ 36%] [ 36%] [ 42%] Generating python/sipArcuspart0.cpp, python/sipArcuspart1.cpp, python/sipArcuspart2.cpp, python/sipArcuspart3.cpp, python/sipArcuspart4.cpp, python/sipArcuspart5.cpp, python/sipArcuspart6.cpp, python/sipArcuspart7.cpp
Running Python protocol buffer compiler on example.proto

Running C++ protocol buffer compiler on example.proto
Scanning dependencies of target python_module_Arcus
Scanning dependencies of target example
[ 47%] [ 52%] Building CXX object examples/CMakeFiles/example.dir/example.pb.cc.o
Building CXX object examples/CMakeFiles/example.dir/example.cpp.o
[ 57%] [ 63%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart0.cpp.o
Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart1.cpp.o
[ 68%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart2.cpp.o
[ 73%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart3.cpp.o
[ 78%] [ 84%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart4.cpp.o
Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart5.cpp.o
[ 89%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart6.cpp.o
[ 94%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/sipArcuspart7.cpp.o
[100%] Building CXX object CMakeFiles/python_module_Arcus.dir/python/PythonMessage.cpp.o
In file included from /home/rick/dev/libArcus/python/PythonMessage.cpp:24:0:
/usr/include/google/protobuf/reflection.h:539:37: error: 'is_proto_enum' was not declared in this scope
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                     ^
/usr/include/google/protobuf/reflection.h:539:52: error: template argument 1 is invalid
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                                    ^
/usr/include/google/protobuf/reflection.h:539:60: error: expected '(' before '>' token
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                                            ^
/usr/include/google/protobuf/reflection.h:539:60: error: template argument 2 is invalid
/usr/include/google/protobuf/reflection.h:539:63: error: expected '{' or ':' before 'type'
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                                               ^
/usr/include/google/protobuf/reflection.h:539:63: error: expected '{' before 'type'
/usr/include/google/protobuf/reflection.h:539:67: error: expected initializer before '>' token
     T, typename internal::enable_if<is_proto_enum<T>::value>::type> {
                                                                   ^
CMakeFiles/python_module_Arcus.dir/build.make:263: recipe for target 'CMakeFiles/python_module_Arcus.dir/python/PythonMessage.cpp.o' failed
make[2]: *** [CMakeFiles/python_module_Arcus.dir/python/PythonMessage.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/python_module_Arcus.dir/all' failed
make[1]: *** [CMakeFiles/python_module_Arcus.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable example
[100%] Built target example
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2
@nallath
Copy link
Member

nallath commented Feb 21, 2016

This is caused by having the wrong version of protobuf. Recently Ubuntu added protobuff 2 to the distro (which can be seen in your make file as it finds protobuf in /usr/lib. We require protobuf 3 to work.

@thopiekar
Copy link
Contributor

You can browse the web for my PPA where I have an upgraded version of protobuf packaged.
If you plan to run Cura at the end, you can also install it from there, too.

@Tweakmind
Copy link

I made and installed protobuf from the Cura repository. I've tried leveraging cura-build as well. I always get the same error as companje. I removed the /usr/local/include/google/protobuf/ and then built and reinstalled the protobuf from the repository. I still end up with the same error on make for libArcus.

@Tweakmind
Copy link

I downloaded protobuf from:

https://github.com/google/protobuf/archive/v3.0.0-beta-2.tar.gz

./autogen.sh
./configure
make
make check
sudo make install

Then inside a fresh libArcus git clone:

mkdir build && cd build
cmake ..
make
sudo make install

It worked.

@BagelOrb
Copy link
Contributor

Make sure libArcus is getting the protobuf from the right location.
Uninstall all protobuff versions which you don't need.

Sometimes arcus just takes the wrong protobuf if you've got multiple on
you'd system..
Op 22 mrt. 2016 08:08 schreef "Tweakmind" [email protected]:

I downloaded protobuf from:

https://github.com/google/protobuf/archive/v3.0.0-beta-2.tar.gz

./autogen.sh
./configure
make
make check
sudo make install

Then inside a fresh libArcus git clone:

mkdir build && cd build
cmake ..
make
sudo make install

It worked.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#18 (comment)

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

5 participants