Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile time issue on ubuntu 12.04 #3

Open
phpconnect opened this issue Apr 11, 2014 · 1 comment
Open

Compile time issue on ubuntu 12.04 #3

phpconnect opened this issue Apr 11, 2014 · 1 comment

Comments

@phpconnect
Copy link

When i am trying to compile this library getting following errors

g++ -std=c++11 -fPIC -shared src/_.cpp -lrocksdb -lpthread -lrt -lsnappy -lgflags -lz -lbz2 -lphpcpp -lmemenv -I./src/include -o bin/rocksdb_php.so
/usr/bin/ld.bfd.real: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librocksdb.a(db_impl.o): relocation R_X86_64_32S against `ZTVN7rocksdb2DBE' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/librocksdb.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *
* [all] Error 1

Please help

@rbrasga
Copy link

rbrasga commented Jun 22, 2016

This solution has helped resolve a problem with the rocksdb-php source code (Photonios/rocksdb-php#4)

This solution also resolved the same bug I was running into with Mongo-Rocks

After you've install all dependencies, you can simply run:

make clean
CFLAGS=-fPIC CXXFLAGS=-fPIC make

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

No branches or pull requests

2 participants