Thanks. Is there an ADD or DELETE macro that gets defined somewhere in your
MSVC? It doesn't seem like the compiler has a problem with previous enum
typedefs, so I'm guessing that there may be a name conflict with your enum
names, and it's expanding to code which no longer compiles. Can you try
making your enum names more descriptive like OPERATION_ADD, OPERATION_DELETE
etc, and see if you still get the same compiler error?

On Wed, Dec 9, 2009 at 11:05 AM, Shawn Mitchell <
robertshawnmitch...@gmail.com> wrote:

> Jason,
>
> Here are the files.  This is confidential and proprietary, yadda yadda
> yadda. So please don't paint your custom van with this code.
>
> Thanks,
>
> Shawn
>
>
> On Wed, Dec 9, 2009 at 1:46 PM, protobuff_programmer <
> robertshawnmitch...@gmail.com> wrote:
>
>> I'm getting a strange error that I'm hoping someone here has seen
>> before and can help me with.  I have included below the compiler
>> output from Microsoft Visual Studio, the proto file and the generated
>> header that is triggering the error.  The line (4520) in the compiler
>> messages is flagged by >>> in the source code below.  I'm sure this is
>> user error and not a problem with protocol buffers, but I'm really at
>> a loss so I'm hoping a kind soul here will take pity on me and help me
>> figure this one out.
>>
>> Thanks in advance,
>>
>> Protobuff Programmer
>>
>>
>> 1>c:\users\shawn\development\platform\trunk\fixgateway\src\fixgateway
>> \Messaging/TradingSystem/ConfigurationProtocol.pb.h(4520) : error
>> C2059: syntax error : 'constant'
>> 1>c:\users\shawn\development\platform\trunk\fixgateway\src\fixgateway
>> \Messaging/TradingSystem/ConfigurationProtocol.pb.h(4520) : error
>> C2258: illegal pure syntax, must be '= 0'
>> 1>c:\users\shawn\development\platform\trunk\fixgateway\src\fixgateway
>> \Messaging/TradingSystem/ConfigurationProtocol.pb.h(4520) : error
>> C4430: missing type specifier - int assumed. Note: C++ does not
>> support default-int
>> 1>c:\users\shawn\development\platform\trunk\fixgateway\src\fixgateway
>> \Messaging/TradingSystem/ConfigurationProtocol.pb.h(4520) : warning
>> C4183: 'InstrumentOperation_OperationType': missing return type;
>> assumed to be a member function returning 'int'
>> 1>c:\users\shawn\development\platform\trunk\fixgateway\src\fixgateway
>> \Messaging/TradingSystem/ConfigurationProtocol.pb.h(4520) : error
>> C2253:
>> 'com::streamingedge::platform::protocols::InstrumentOperation::InstrumentOperation_OperationType'
>> :
>> pure specifier or abstract override specifier only allowed on virtual
>> function
>>
>>
>>
>> message InstrumentOperation
>> {
>>        required Header header = 1;
>>        required Instrument instrument = 2;
>>        required OperationType operationType = 3;
>>
>>    enum OperationType
>>        {
>>                ADD = 0;
>>                UPDATE = 1;
>>                DELETE = 2;
>>                QUERY = 3;
>>                CANCEL = 4;
>>        }
>> }
>>
>>
>> class InstrumentOperation : public ::google::protobuf::Message
>> {
>>
>>  public:
>>
>>    InstrumentOperation();
>>
>>    virtual ~InstrumentOperation();
>>
>>
>>    InstrumentOperation(const InstrumentOperation& from);
>>
>>
>>    inline InstrumentOperation& operator=(const InstrumentOperation&
>> from) {
>>    CopyFrom(from);
>>    return *this;
>>  }
>>
>>
>>    inline const ::google::protobuf::UnknownFieldSet& unknown_fields()
>> const {
>>    return _unknown_fields_;
>>  }
>>
>>
>>    inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields
>> () {
>>    return &_unknown_fields_;
>>  }
>>
>>
>>    static const ::google::protobuf::Descriptor* descriptor();
>>
>>    static const InstrumentOperation& default_instance();
>>
>>    void Swap(InstrumentOperation* other);
>>
>>
>>    // implements Message
>> ----------------------------------------------
>>
>>
>>    InstrumentOperation* New() const;
>>
>>    void CopyFrom(const ::google::protobuf::Message& from);
>>
>>    void MergeFrom(const ::google::protobuf::Message& from);
>>
>>    void CopyFrom(const InstrumentOperation& from);
>>
>>    void MergeFrom(const InstrumentOperation& from);
>>
>>    void Clear();
>>
>>    bool IsInitialized() const;
>>
>>
>>    int ByteSize() const;
>>
>>    bool MergePartialFromCodedStream
>> (::google::protobuf::io::CodedInputStream* input);
>>
>>    void SerializeWithCachedSizes
>> (::google::protobuf::io::CodedOutputStream* output) const;
>>
>>    ::google::protobuf::uint8* SerializeWithCachedSizesToArray
>> (::google::protobuf::uint8* output) const;
>>
>>    int GetCachedSize() const { return _cached_size_; }
>>
>>  private:
>>
>>    void SharedCtor();
>>
>>    void SharedDtor();
>>
>>    void SetCachedSize(int size) const { _cached_size_ = size; }
>>
>>  public:
>>
>>
>>    ::google::protobuf::Metadata GetMetadata() const;
>>
>>
>>
>>    // nested types
>> ----------------------------------------------------
>>
>>
>>    typedef InstrumentOperation_OperationType OperationType;
>>
>>    static const OperationType ADD =
>> InstrumentOperation_OperationType_ADD;
>>
>>    static const OperationType UPDATE =
>> InstrumentOperation_OperationType_UPDATE;
>>
>> >>> static const OperationType DELETE =
>> InstrumentOperation_OperationType_DELETE;
>>
>>    static const OperationType QUERY =
>> InstrumentOperation_OperationType_QUERY;
>>
>>    static const OperationType CANCEL =
>> InstrumentOperation_OperationType_CANCEL;
>>
>>    static inline bool OperationType_IsValid(int value) {
>>    return InstrumentOperation_OperationType_IsValid(value);
>>  }
>>
>>    static const OperationType OperationType_MIN =
>>    InstrumentOperation_OperationType_OperationType_MIN;
>>
>>    static const OperationType OperationType_MAX =
>>    InstrumentOperation_OperationType_OperationType_MAX;
>>
>>    static inline const ::google::protobuf::EnumDescriptor*
>>  OperationType_descriptor() {
>>    return InstrumentOperation_OperationType_descriptor();
>>  }
>>
>>    static inline const ::std::string& OperationType_Name
>> (OperationType value) {
>>    return InstrumentOperation_OperationType_Name(value);
>>  }
>>
>>    static inline bool OperationType_Parse(const ::std::string& name,
>>      OperationType* value) {
>>    return InstrumentOperation_OperationType_Parse(name, value);
>>  }
>>
>>
>>    // accessors
>> -------------------------------------------------------
>>
>>
>>    // required .com.streamingedge.platform.protocols.Header header =
>> 1;
>>
>>    inline bool has_header() const;
>>  inline void clear_header();
>>
>>    static const int kHeaderFieldNumber = 1;
>>
>>    inline const ::com::streamingedge::platform::protocols::Header&
>> header() const;
>>
>>    inline ::com::streamingedge::platform::protocols::Header*
>> mutable_header();
>>
>>
>>    // required .com.streamingedge.platform.protocols.Instrument
>> instrument = 2;
>>
>>    inline bool has_instrument() const;
>>
>>    inline void clear_instrument();
>>
>>    static const int kInstrumentFieldNumber = 2;
>>
>>    inline
>> const ::com::streamingedge::platform::protocols::Instrument& instrument
>> () const;
>>
>>    inline ::com::streamingedge::platform::protocols::Instrument*
>> mutable_instrument();
>>
>>
>>    //
>> required
>> .com.streamingedge.platform.protocols.InstrumentOperation.OperationType
>> operationType = 3;
>>
>>    inline bool has_operationtype() const;
>>
>>    inline void clear_operationtype();
>>
>>    static const int kOperationTypeFieldNumber = 3;
>>
>>
>> inline
>> ::com::streamingedge::platform::protocols::InstrumentOperation_OperationType
>> operationtype() const;
>>
>>    inline void set_operationtype
>>
>> (::com::streamingedge::platform::protocols::InstrumentOperation_OperationType
>> value);
>>
>>
>>  private:
>>
>>    ::google::protobuf::UnknownFieldSet _unknown_fields_;
>>
>>    mutable int _cached_size_;
>>
>>
>>    ::com::streamingedge::platform::protocols::Header* header_;
>>
>>    ::com::streamingedge::platform::protocols::Instrument*
>> instrument_;
>>
>>    int operationtype_;
>>
>>    friend void  protobuf_AddDesc_ConfigurationProtocol_2eproto();
>>
>>    friend void protobuf_AssignDesc_ConfigurationProtocol_2eproto();
>>
>>    friend void protobuf_ShutdownFile_ConfigurationProtocol_2eproto();
>>
>>
>>    ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32];
>>
>>
>>    // WHY DOES & HAVE LOWER PRECEDENCE THAN != !?
>>
>>    inline bool _has_bit(int index) const {
>>    return (_has_bits_[index / 32] & (1u << (index % 32))) != 0;
>>  }
>>
>>    inline void _set_bit(int index) {
>>    _has_bits_[index / 32] |= (1u << (index % 32));
>>  }
>>
>>    inline void _clear_bit(int index) {
>>    _has_bits_[index / 32] &= ~(1u << (index % 32));
>>  }
>>
>>
>>    void InitAsDefaultInstance();
>>
>>    static InstrumentOperation* default_instance_;
>>
>> };
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.


Reply via email to