Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

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

Open
teanooki opened this issue Dec 1, 2014 · 5 comments
Open

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

teanooki opened this issue Dec 1, 2014 · 5 comments

Comments

@teanooki
Copy link

teanooki commented Dec 1, 2014

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
Copy link

chisleu commented Dec 15, 2014

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
Copy link

Try using thrift 0.9.1 instead, take a look at my posts about similar issue: #47 (comment)

@sergey-nagaytsev
Copy link

@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
Copy link
Contributor

Skunnyk commented Oct 19, 2015

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants