Guoguang Lan created THRIFT-3924:
------------------------------------
Summary: Make C++ library build on SunOS
Key: THRIFT-3924
URL: https://issues.apache.org/jira/browse/THRIFT-3924
Project: Thrift
Issue Type: Bug
Environment: 1.upgrade thrift from 0.9.0 to 0.9.2
2.SunOS
3.stdcxx4
4.CC compiler
Reporter: Guoguang Lan
when Both Clang and GNUC are not define , there is an error!
1.upgrade thrift from 0.9.0 to 0.9.2
2.SunOS
3.stdcxx4
compile: CC -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift
-I/CBB_3rdTools/server/OpenSource/src/thrift/thrift-0.9.2/boost_1_57_0//include
-I./src -D_POSIX_PTHREAD_SEMANTICS -D_SUN_ -DSUN
-I/CBB_3rdTools/server/OpenSource/src/thrift/thrift-0.9.2/openssl/include
-I/CBB_3rdTools/server/OpenSource/src/thrift/thrift-0.9.2/boost_1_57_0/include/boost/tr1
-Wextra -pedantic -g -c src/thrift/transport/TFileTransport.cpp -KPIC -DPIC -o
src/thrift/transport/.libs/TFileTransport.o CC: Warning: Option -Wextra passed
to ld, if ld is invoked, ignored otherwise CC: Warning: Option -pedantic passed
to ld, if ld is invoked, ignored otherwise "./src/thrift/cxxfunctional.h", line
124: Error: stdcxx is not a member of apache::thrift.
when i modify the code like this:
`#ifdef clang
/* Clang has two options, depending on standard library:
- no -stdlib or -stdlib=libstdc++ set; uses GNU libstdc++.
- -stdlib=libc++; uses LLVM libc++.
, no 'std::tr1'. *
The compiler itself doesn't define anything differently
depending on the value of -stdlib, but the library headers
will set different preprocessor options. In order to check,
though, we have to pull in some library header.
*/
#include
/* With LLVM libc++, utility pulls in __config, which sets
_LIBCPP_VERSION. */
#if defined(_LIBCPP_VERSION)
#define _THRIFT_USING_CLANG_LIBCXX 1
/* With GNU libstdc++, utility pulls in bits/c++config.h,
which sets GLIBCXX. */
#elif defined(GLIBCXX)
#define _THRIFT_USING_GNU_LIBSTDCXX 1
/* No idea. /
#else
#error Unable to detect which C++ standard library is in use.
#endif
#elif GNUC
#define _THRIFT_USING_GNU_LIBSTDCXX 1
/ No idea. */
#else
#error Unable to detect which C++ standard library is in use. Both Clang and
GNUC are not define!
#endif`
output:
"./src/thrift/cxxfunctional.h", line 71: Error: #error Unable to detect which
C++ standard library is in use. Both Clang and GNUC are not define!.
Thank you!
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)