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
    Commented Jun 11, 2018 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 Commented Jun 11, 2018 at 10:45
  • @dEBRUYNE can you please check the question, make command is throwing error. Commented Jun 11, 2018 at 11:04
  • Please see glv's answer.
    – dEBRUYNE
    Commented Jun 11, 2018 at 17:15

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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