Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-621

namespace cpp org.apache.* causes compilation issues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.1
    • 0.2
    • C++ - Compiler
    • None
    • tested on both g++ 4.1.2 (gentoo amd64) and g++ 4.3.3 (ubuntu x86), latest thrift trunk

    Description

      There seems to be a conflict between the apache::thrift namespace used in the generated code and the org::apache namespace when specified in the .thrift file. I noticed this when trying to compile a c++ client for Cassandra.

      It seems that since the generated c++ files are in the org::apache namespace, when the compiler sees something like apache::thrift::protocol, it tries to look for org::apache::thrift::protocol. One fix for this would be to instead use ::apache::thrift in the generated code. Another fix would be to use org::apache::thrift as the thrift namespace.

      I'm attaching a minimal example (most files taken from the tutorial) to demonstrate the issue. If you change the namespace in the .thrift file (as well as the using directives in the client and server), it will compile fine.

      Attachments

        1. thrift_621_example.zip
          9 kB
          Ben Taitelbaum
        2. thrift_621_add_colons.patch
          23 kB
          Ben Taitelbaum

        Issue Links

          Activity

            People

              coshx Ben Taitelbaum
              coshx Ben Taitelbaum
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: