Hello,
Does anyone have some example code of using building this?
My steps, I'm trying to build a shared library using the thrift api

1. Checked out from SVN (trunk)

2. Made a directory called thrift, into which I place fb303.thrift, 
 hive_metastore.thrift,hive_service.thrift,queryplan.thrift
 
 - I made changes to the include paths in the thrift files
 - Also changed the namespace of the queryplan thrift file to match those of
 - hive_metastore and hive_service (i.e Apache::Hadoop::Hive)

3. Do thrift -r --gen hive_service.thrift 
   which creates all the cpp and .h files in gen-cpp

3. Build all the files, but this error occurs

g++ -m64 -I/usr/include/R  -I/usr/local/include   -I. -g  -DHAVE_UINTPTR_T 
-I./gen-cpp `pkg-config --cflags thrift` -Wall -fpic  -O2 -g -pipe -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -c 
ThriftHiveMetastore_server.skeleton.cpp -o ThriftHiveMetastore_server.skeleton.o

ThriftHiveMetastore_server.skeleton.cpp: In function 'int main(int, char**)':
ThriftHiveMetastore_server.skeleton.cpp:224: error: cannot allocate an object 
of abstract type 'ThriftHiveMetastoreHandler'
ThriftHiveMetastore_server.skeleton.cpp:19: note:   because the following 
virtual functions are pure within 'ThriftHiveMetastoreHandler':
FacebookService.h:17: note:     virtual void 
facebook::fb303::FacebookServiceIf::getName(std::string&)
FacebookService.h:18: note:     virtual void 
facebook::fb303::FacebookServiceIf::getVersion(std::string&)
FacebookService.h:19: note:     virtual facebook::fb303::fb_status::type 
facebook::fb303::FacebookServiceIf::getStatus()
FacebookService.h:20: note:     virtual void 
facebook::fb303::FacebookServiceIf::getStatusDetails(std::string&)
FacebookService.h:21: note:     virtual void 
facebook::fb303::FacebookServiceIf::getCounters(std::map<std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >, long int, 
std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> 
> >, std::allocator<std::pair<const std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, long int> > >&)
FacebookService.h:22: note:     virtual int64_t 
facebook::fb303::FacebookServiceIf::getCounter(const std::string&)
FacebookService.h:23: note:     virtual void 
facebook::fb303::FacebookServiceIf::setOption(const std::string&, const 
std::string&)
FacebookService.h:24: note:     virtual void 
facebook::fb303::FacebookServiceIf::getOption(std::string&, const std::string&)
FacebookService.h:25: note:     virtual void 
facebook::fb303::FacebookServiceIf::getOptions(std::map<std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, 
std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> 
> >, std::allocator<std::pair<const std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >, std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > > > >&)
FacebookService.h:26: note:     virtual void 
facebook::fb303::FacebookServiceIf::getCpuProfile(std::string&, int32_t)
FacebookService.h:27: note:     virtual int64_t 
facebook::fb303::FacebookServiceIf::aliveSince()
FacebookService.h:28: note:     virtual void 
facebook::fb303::FacebookServiceIf::reinitialize()
FacebookService.h:29: note:     virtual void 
facebook::fb303::FacebookServiceIf::shutdown()


Any pointers would be appreciated. I know that a language called C++ exists
:). I rarely use it. So this could be something to obvious (and silly of me).

Thanks
Joy

Reply via email to