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

Missing <operator body

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 0.9
    • Fix Version/s: 0.10.0
    • Component/s: C++ - Compiler
    • Labels:
      None
    • Environment:

      Fedora 19
      g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)

      Description

      When I compile:

      d.thrift
      struct Ala {
      	1: optional i32 a
      }
      
      struct Basia {
      	1: optional map<Ala, i32> b
      }
      
      main.cpp
      #include <iostream>
      #include "gen-cpp/d_types.h"
      
      int main() {
          Basia b;
      
          return 0;
      }
      
      makefile
      GEN_SRC := main.cpp\
      gen-cpp/d_constants.cpp \
      gen-cpp/d_types.cpp \
      
      GEN_OBJ := $(patsubst %.cpp,%.o, $(GEN_SRC))
      
      THRIFT_DIR := /usr/local/include/thrift
      BOOST_DIR := /usr/local/include
      
      INC := -I$(THRIFT_DIR) -I$(BOOST_DIR)
      
      .PHONY: all clean
      
      all:  main
      
      %.o: %.cpp 
      	$(CXX) --std=c++11 -Wall -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H $(INC) -c $< -o $@
      
      main: main.o $(GEN_OBJ)
      	$(CXX) $^ -o $@ -L/usr/local/lib -lthrift
      
      clean:
      	$(RM) *.o gen-cpp/*.o main
      

      I get an error:

      g++ main.o gen-cpp/d_constants.o gen-cpp/d_types.o -o main -L/usr/local/lib -lthrift
      gen-cpp/d_types.o: In function `std::less<Ala>::operator()(Ala const&, Ala const&) const':
      d_types.cpp:(.text._ZNKSt4lessI3AlaEclERKS0_S3_[_ZNKSt4lessI3AlaEclERKS0_S3_]+0x14): undefined reference to `Ala::operator<(Ala const&) const'
      collect2: error: ld returned 1 exit status
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                blackbox.dev Blackbox Dev Team
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: