I got this error after I run make -j4 after cmake ..

Linking CXX shared library ../../lib/libCnoidUtil.so

/usr/bin/ld: ../../lib/libyaml.a(api.c.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

../../lib/libyaml.a: error adding symbols: Bad value

collect2: error: ld returned 1 exit status

make[2]: *** [lib/libCnoidUtil.so.1.6] Error 1

make[1]: *** [src/Util/CMakeFiles/CnoidUtil.dir/all] Error 2

make: *** [all] Error 2

Do you have any idea how to solve this problem? I've tried to read many answer, but I cannot really understand how to solve it. I've quite new to ubuntu.

Anyone please help!!

  • What are you trying to build and where did you get it from? sometimes these kinds of errors occur because the source is not "clean" i.e. contains object files or libraries from a previous build or different system architecture – steeldriver Apr 5 '17 at 2:01
  • @steeldriver I could make it once, but when I delete it. I want to remake. But it hasn't worked anymore and show this error – Tanya Apr 6 '17 at 1:27
  • Does the Makefile provide a clean target? if so, did you run it (make clean) between builds? – steeldriver Apr 6 '17 at 1:34
  • .I alrealy use "make clean" after error. Then "make" again. But still not working:( – Tanya Apr 6 '17 at 14:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.