I had uploaded a patch for this as part of THRIFT-925. https://issues.apache.org/jira/browse/THRIFT-925?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
HTH, Sudhir On Wed, Feb 9, 2011 at 5:52 PM, Tony Valderrama <[email protected]>wrote: > Hi folks, I just tried to build fb303 as included with Thrift 0.6.0. I'm > running 64-bit Ubuntu 10.04. > > Here's a snippet from the 'make' output: > > ----------- > g++ -DPACKAGE_NAME=\"libfb303\" -DPACKAGE_TARNAME=\"libfb303\" > -DPACKAGE_VERSION=\"20080209\" -DPACKAGE_STRING=\"libfb303\ 20080209\" > -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -I. -I.. > -Igen-cpp -I/usr/local/include/thrift -I/usr/include -Wall -O3 -MT > fb303_types.o -MD -MP -MF .deps/fb303_types.Tpo -c -o fb303_types.o `test > -f > 'gen-cpp/fb303_types.cpp' || echo './'`gen-cpp/fb303_types.cpp > gen-cpp/fb303_types.cpp:11: error: ‘fb_status’ is not a class or namespace > gen-cpp/fb303_types.cpp:12: error: ‘fb_status’ is not a class or namespace > gen-cpp/fb303_types.cpp:13: error: ‘fb_status’ is not a class or namespace > gen-cpp/fb303_types.cpp:14: error: ‘fb_status’ is not a class or namespace > gen-cpp/fb303_types.cpp:15: error: ‘fb_status’ is not a class or namespace > gen-cpp/fb303_types.cpp:16: error: ‘fb_status’ is not a class or namespace > make[3]: *** [fb303_types.o] Error 1 > make[3]: Leaving directory > `/home/tvalderrama/test-software/thrift-0.6.0/contrib/fb303/cpp' > ----------- > > It seems that Thrift has generated c++ code which is accessing enum values > as if they were static members of a class (or more likely enum constants > inside a wrapper class). Here's the patch to the generated code which lets > it compile successfully: > > ----------- > $ diff cpp/gen-cpp/fb303_types.cpp{.old,} -u > --- cpp/gen-cpp/fb303_types.cpp.old 2011-02-09 13:13:32.616740084 +0100 > +++ cpp/gen-cpp/fb303_types.cpp 2011-02-09 13:13:56.956744959 +0100 > @@ -8,12 +8,12 @@ > namespace facebook { namespace fb303 { > > int _kfb_statusValues[] = { > - fb_status::DEAD, > - fb_status::STARTING, > - fb_status::ALIVE, > - fb_status::STOPPING, > - fb_status::STOPPED, > - fb_status::WARNING > + DEAD, > + STARTING, > + ALIVE, > + STOPPING, > + STOPPED, > + WARNING > }; > const char* _kfb_statusNames[] = { > "DEAD", > ----------- > > Any suggestions? I'm not familiar with the Thrift/fb303 codebase at all. > Is this somehow a configuration problem I can fix, or should I file a bug > somewhere? > > Thanks, > Tony > -- Regards, Sudhir Jorwekar
