Orange-OpenSource / YACassandraPDO

Cassandra PDO Driver fork
Apache License 2.0
84 stars 32 forks source link

error: ‘org::apache::thrift’ has not been declared #75

Open teanooki opened 9 years ago

teanooki commented 9 years ago

Building YACassandraPDO on Ubuntu 14.04 with the most recent Thrift 0.9.2 aborts with the following error:

/home/user/YACassandraPDO/gen-cpp/cassandra_types.cpp: In function ‘std::ostream& org::apache::cassandra::operator<<(std::ostream&, const org::apache::cassandra::Column&)’:
/home/user/YACassandraPDO/gen-cpp/cassandra_types.cpp:243:17: error: ‘org::apache::thrift’ has not been declared
   using apache::thrift::to_string;
                 ^
/home/user/YACassandraPDO/gen-cpp/cassandra_types.cpp:245:39: error: ‘to_string’ was not declared in this scope
   out << "name=" << to_string(obj.name);
                                       ^

Changing all using apache::thrift::to_string; to using ::apache::thrift::to_string; in gen-cpp/cassandra_types.cpp solved this problem and lets me build the module.

chisleu commented 9 years ago

I'm in a very similar boat. I'm on CentOS 5.6 and I tried using as much software from the yum repo as possible and getting this to compile, but no joy. I tried using the instructions at thrift.apache.org and using recent versions of lua, thrift, boost, autoconf, automake, etc. Still no joy.

I made my own issue (because I saw a typo in the docs) but I thought I would +1 this. I wish the docs were a little more inclusive. It seems like the standard devel environment is debian or older version of ubuntu.

I'm being shewed off of this (spent ~4 hours trying to get this to compile.) I am going to write a node.js RESTful API to interface with Cassandra. I could have done it already, but I try to give my boss native PHP tools to use so he feels comfortable. Our instances tend to be CPU heavy anyway, so a little overhead for a RESTful API should be fine provided I can keep node inside of some memory constraints. It should be easy since express.js and the cassandra-driver for node.js both support streaming results w/o buffering.

LexLythius commented 9 years ago

Try using thrift 0.9.1 instead, take a look at my posts about similar issue: https://github.com/Orange-OpenSource/YACassandraPDO/issues/47#issuecomment-51669503

sergey-nagaytsev commented 9 years ago

@mdiesing +1 for this,

#!/bin/sh

phpize
./configure
cd gen-cpp
sed s/apache::thrift::to_string/::apache::thrift::to_string/ cassandra_types.cpp | sponge cassandra_types.cpp
cd ..
make

and it builds.

Skunnyk commented 9 years ago

For thrift 0.9.3:

 sed -i "s/apache::thrift::protocol::TInputRecursionTracker/::apache::thrift::protocol::TInputRecursionTracker/" gen-cpp/Cassandra.cpp gen-cpp/cassandra_types.cpp
 sed -i "s/apache::thrift::protocol::TOutputRecursionTracker/::apache::thrift::protocol::TOutputRecursionTracker/" gen-cpp/Cassandra.cpp gen-cpp/cassandra_types.cpp
ahsanatiq commented 8 years ago

I was struggling with the build process for the past 2 days, the sed method worked for me... Thanks guys.