0

I am trying to setup Monero blockchain explorer on Ubuntu 16.04 by following this github repo.

I have checkout monero v0.12.1.0

but I am facing this error while running make command

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libgtest.a(gtest-all.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libgtest.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status tests/unit_tests/CMakeFiles/unit_tests.dir/build.make:1206: recipe for target 'tests/unit_tests/unit_tests' failed make[3]: * [tests/unit_tests/unit_tests] Error 1 make[3]: Leaving directory '/home/monero/build/release' CMakeFiles/Makefile2:4425: recipe for target 'tests/unit_tests/CMakeFiles/unit_tests.dir/all' failed make[2]: [tests/unit_tests/CMakeFiles/unit_tests.dir/all] Error 2 make[2]: Leaving directory '/home/monero/build/release' Makefile:138: recipe for target 'all' failed make1: [all] Error 2 make1: Leaving directory '/home/monero/build/release' Makefile:64: recipe for target 'release-all' failed make: * [release-all] Error 2

I couldn't find any solution yet? can anyone help?

  • Did you follow this part on the README? github.com/moneroexamples/… – dEBRUYNE Jun 11 '18 at 10:18
  • @dEBRUYNE yes I followed this part, right now I am trying to re-setup, checked out the monero now running make command. may be I missed something – Owais Aslam Jun 11 '18 at 10:45
  • @dEBRUYNE can you please check the question, make command is throwing error. – Owais Aslam Jun 11 '18 at 11:04
  • Please see glv's answer. – dEBRUYNE Jun 11 '18 at 17:15
3

The error "/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/libgtest.a(gtest-all.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC" tells you that the libgtest.a file of your system has not been compiled with position independent code, which is necessary to compile monerod.

You must either compile gtest with the -fPIC flag on your system or uninstall the gtest version on your system for the version of gtest embedded in the monero source code to be used.

The second solution is probably easier:

apt-get remove libgtest-dev
cd directory_of_the_monero_sources
make clean
make
  • Thankyou so much! – Owais Aslam Jun 12 '18 at 5:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.