Blackbox Dev Team created THRIFT-2154:
-----------------------------------------

             Summary: Missing <operator body
                 Key: THRIFT-2154
                 URL: https://issues.apache.org/jira/browse/THRIFT-2154
             Project: Thrift
          Issue Type: Bug
          Components: C++ - Compiler
    Affects Versions: 0.9
         Environment: Fedora 19
g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)
            Reporter: Blackbox Dev Team


When I compile:
{code:title=d.thrift}
struct Ala {
        1: optional i32 a
}

struct Basia {
        1: optional map<Ala, i32> b
}
{code}

{code:title=main.cpp}
#include <iostream>

#include "gen-cpp/d_types.h"
int main() {
    Basia b;

    return 0;
}
{code}

{code:title=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
{code}
I get an error:
{code}
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
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to