-
Notifications
You must be signed in to change notification settings - Fork 28
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
Build Issue with Protobuf v3.5.1 Related to c++11 #29
Comments
Hi @amitfishy I am encountering the same issue in Protobuf v3.6.1 and I cant compile C++. I've read that adding this "-std=c++ 11" would make it work. On which folder should I add this? Because I have CMakelists.txt in protobuf-master/cmake/ and protobuf-master/examples. I've added this to both but I still encounter the same error. Please help!! |
Hi @deji04 This was my problem as well, sorry I can't help you with it. I tried adding it in a few places (like where I mentioned in my post), but it didn't really work. By my understanding, it should work when you add the flag to the makefile. Also, it seems there's only a single CMakeLists in the main folder, and when I look at the repo there is no folder called 'examples' and cmake does not have anything in it (apart from one file). Maybe you should remove the files that were generated after the first failed build before starting again (or start from scratch with the clean repo). It's also possible that it does not support c++11 yet, unfortunately, I've not got a reply here to confirm this. In any case, if you really need it to work, try downgrading to v2 of the protobuf. That is what I did. Thanks |
Thanks Amit for the response! I have a question though. I just installed protobuf 2weeks ago, I assume that I have v3 protobuf and libprotoc v3.6.1. I built it from Source and follow every single step of the installation. So how do I install v2 of protobuf? I've checked with my gcc version, I have v4.8.5 since that is the default version for Centos7. I've been updating the gcc version since Thurs, and it is not done yet (i'm looking at CPU issue here). I hope that it would finish today so I can proceed with my testing of C++. Anyways, the "examples" folder is included during installation of protoc v3.6.1. I've tried putting -std=c++11 in Makefile but the error its throwing now is "/bash/sh: add_person.cc: command not found". This got me confused more. :( Thanks! |
Hi Amit, I solved my issue now and finished testing. What I did is i installed the gcc version 6.3.1 and run "make cpp" as instructed. And it ran without any errors. Thanks! |
Hi
I'm currently using Ubuntu 16 and trying to build maplab and my build is failing for protobuf_catkin because of the different version of protobuf version I am using. I know this for sure because I had the exact same problem while trying to install caffe which also uses google's protocol buffers and I was able to fix the problem by adding
-std=c++11
toCXXFLAGS
in the makefile. It seems that the build works out of the box when I use protobuf v2 which follows the c++98 standard, so how do I modify the existing makefiles of this package to put this flag?Sorry that this question is more related to c++ CMakelists.txt and ROS in general and not actually a problem with the wrapper, but I just thought its better to put it out there if someone tries to use it with the latest version of protobuf.
EDIT: I've tried adding the following to the CMakelists.txt file (after 'project') but it is still giving the same error:
Here is a small portion of the error log:
The text was updated successfully, but these errors were encountered: