Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Cpp2Ops::serializedSize functions used in Tensor_types.h are not match the declaration in thrift #35

Open
dearhoper opened this issue Feb 15, 2017 · 1 comment

Comments

@dearhoper
Copy link

After the updating of fbthrift to the newest version, the rebuilding of the thpp met servel problems.
The first problems:

[  7%] Building CXX object CMakeFiles/thpp.dir/Storage.cpp.o
In file included from /opt/packages/thpp/thpp/../thpp/Storage.h:15:0,
                 from /opt/packages/thpp/thpp/Storage.cpp:11:
./thpp/if/gen-cpp2/Tensor_types.h:149:55: error: template-id ‘serializedSize<>’ for ‘uint32_t apache::thrift::Cpp2Ops<thpp::ThriftTensor>::serializedSize(Protocol*, const thpp::ThriftTensor*)’ does not match any template declaration
 template <> template <class Protocol> inline uint32_t Cpp2Ops< ::thpp::ThriftTensor>::serializedSize(Protocol* proto, const  ::thpp::ThriftTensor* obj) {
                                                       ^
./thpp/if/gen-cpp2/Tensor_types.h:153:55: error: template-id ‘serializedSizeZC<>’ for ‘uint32_t apache::thrift::Cpp2Ops<thpp::ThriftTensor>::serializedSizeZC(Protocol*, const thpp::ThriftTensor*)’ does not match any template declaration
 template <> template <class Protocol> inline uint32_t Cpp2Ops< ::thpp::ThriftTensor>::serializedSizeZC(Protocol* proto, const  ::thpp::ThriftTensor* obj) {
                                                       ^
./thpp/if/gen-cpp2/Tensor_types.h:227:55: error: template-id ‘serializedSize<>’ for ‘uint32_t apache::thrift::Cpp2Ops<thpp::ThriftStorage>::serializedSize(Protocol*, const thpp::ThriftStorage*)’ does not match any template declaration
 template <> template <class Protocol> inline uint32_t Cpp2Ops< ::thpp::ThriftStorage>::serializedSize(Protocol* proto, const  ::thpp::ThriftStorage* obj) {
                                                       ^
./thpp/if/gen-cpp2/Tensor_types.h:231:55: error: template-id ‘serializedSizeZC<>’ for ‘uint32_t apache::thrift::Cpp2Ops<thpp::ThriftStorage>::serializedSizeZC(Protocol*, const thpp::ThriftStorage*)’ does not match any template declaration
 template <> template <class Protocol> inline uint32_t Cpp2Ops< ::thpp::ThriftStorage>::serializedSizeZC(Protocol* proto, const  ::thpp::ThriftStorage* obj) {
                                                       ^
make[2]: *** [CMakeFiles/thpp.dir/Storage.cpp.o] Error 1
make[1]: *** [CMakeFiles/thpp.dir/all] Error 2
make: *** [all] Error 2

I viewed the codes of Cpp2Ops class in thrift/lib/cpp2/Thrift.h, and find the reason.
In Thrift.h:
template <> template <class Protocol> inline uint32_t Cpp2Ops< ::thpp::ThriftTensor>::serializedSize(const Protocol* proto, const ::thpp::ThriftTensor* obj)
here is const Protocol* proto not Protocol* proto

I tried to modify the Tensor_type.h file but it was always refreshed after the make command.
So, how to fix it?

@dearhoper
Copy link
Author

Go on, I found several problems.

  1. Failed to generate Tensor_data.h and .cpp files. No error prompts but the make process will recompile all files that depend on Tensor_data.h. It prevents the modification of Tensor_types.h.
    So I removed all the content about "Tensor_data". Then met:

  2. Missing definitions for TEnumIterator and TEnumInverseIterator. These two have beed removed after fbthrift-2016.10.31.00. But thpp is still using them.
    So I added these definitions back to thrift/lib/cpp/Thrift.h. Then met

  3. Linking CXX executable storage_test
    /usr/local/lib/libthriftcpp2.so: undefined reference to 'folly::EventBase::runImmediatelyOrRunInEventBaseThreadAndWait(folly::Function<void ()>)'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant