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

protobuf is ok? #552

Open
zdy0009 opened this issue Mar 21, 2019 · 1 comment
Open

protobuf is ok? #552

zdy0009 opened this issue Mar 21, 2019 · 1 comment

Comments

@zdy0009
Copy link

zdy0009 commented Mar 21, 2019

I use counter.proto to create some files ,when I compile ,error happened :Linking CXX shared library lib/libcounter.so
/usr/bin/ld: /home/zdy/rdsninstall/lib/libprotobuf.a(arena.cc.o): relocation R_X86_64_32 against `_ZN6google8protobuf5Arena23lifecycle_id_generator_E' can not be used when making a shared object; recompile with -fPIC
/home/zdy/rdsninstall/lib/libprotobuf.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libcounter.so] Error 1
make[1]: *** [CMakeFiles/counter.dir/all] Error 2
make: *** [all] Error 2
ERROR: build failed

Is that protobuf not ok?

@linmajia linmajia assigned linmajia and imzhenyu and unassigned linmajia Mar 21, 2019
@linmajia
Copy link
Collaborator

linmajia commented Apr 2, 2019

@zdy0009 , sorry for late response.

By default, protobuf is compiled as a static library without the compiler argument "-fPIC" (position-independent code). Please open the file "ext/protobuf/CMakeLists.txt", add "-DCMAKE_POSITION_INDEPENDENT_CODE=ON;" after line 13 (quotation mark is needed) and have a try.

Thanks!

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

3 participants