Would it be possible to remove this from common.h?
Since common.h is indirectly included from all generated code, this
basically means that if you use any protobuf related classes in a
header file (for example, a private member function that returns an
enum), common.h must be indirectly visible from the header file, and
as such any cpp file that includes this header file. In my case, I
was including one of the generated files in StdAfx.h in windows, which
is for precompiled headers, meaning that I was essentially using
namespace std for my entire project.
It even has a comment in the code that says "This is bad kids, don't
do this at home" ;-) I manually went through and modified the code
and qualified all the references with std::, but this is still not
ideal, as I'll have to do it again when I upgrade the protobuf
version. Luckily the generated code qualifies its references with
std::, otherwise I'd have been really screwed.
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to email@example.com
To unsubscribe from this group, send email to
For more options, visit this group at