You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Deepak Muley <de...@hds.com> on 2012/05/22 20:20:07 UTC

fb303 + libthrift windows compilation in thrift 0.8.0

Hello All,

Question:
Has anyone tried using fb303.lib and libthrift.lib in the app using thrift 0.8.0 windows. Am facing some issues, can someone share the knowledge of compiling it if they were successful.

Background:
I used thrift 0.6.0 + thrift-1123<https://issues.apache.org/jira/browse/THRIFT-1123> patch before and things were working fine for me.

Now am planning to upgrade to thrift 0.8.0 considering that this windows patch is already in the trunk now.

I used the 0.8.0 sln file which comes with the build for libthirft compilation and added a new project for compiling fb303 as it did not exist in this new sln.

Added following macros and appropriate paths of boost and pthread.
THRIFT_NO_CONTENTION_PROFILING
HAVE_CONFIG_H
HAVE_PTHREAD_H
HAVE_STRUCT_TIMESPEC

Also since FacebookBase.h uses ReadWriteMutex, had to add Mutex.cpp/h in the fb303 solution to make it work with my app.
Fb303.lib and libthrift.lib now compiled.

Now in my app I am using both these static libraries which is causing the issue where fb303 uses Mutex.h and libthrift also uses Mutex.h but one uses classes from Mutex.cpp and other uses BoostMutex.cpp respectively hence the collision linker errors of redefinition.

Now my basic question is, has anyone tried this before and if yes then can you provide me some tips on how did you manage it.

Thanks in advance.

~Deepak Muley