Author Topic: relocation R_X86_64_PC32 against symbol  (Read 69 times)

aos

  • Community Member
  • Posts: 13
  • Hero Points: 0
relocation R_X86_64_PC32 against symbol
« on: December 02, 2019, 09:21:14 am »
Hello,
i'm trying to build my project and i get this error:

/usr/bin/ld: Debug/apppath.o: relocation R_X86_64_PC32 against symbol `_ZN5boost10filesystem4pathC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

I know I need to add -fPIC to the CFLAGS. (like in Makefile)

How do i do it in slickedit?

Thanks,
Aviel.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2388
  • Hero Points: 133
Re: relocation R_X86_64_PC32 against symbol
« Reply #1 on: December 02, 2019, 11:05:13 am »
How are you building?  Are you using the editor to manage the project, or running a command for build.

aos

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: relocation R_X86_64_PC32 against symbol
« Reply #2 on: December 02, 2019, 11:19:47 am »
i'm using the editor.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2388
  • Hero Points: 133
Re: relocation R_X86_64_PC32 against symbol
« Reply #3 on: December 02, 2019, 12:03:12 pm »
So on the Project properties>Tools, and select Build tab, which radio button is selected?

aos

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: relocation R_X86_64_PC32 against symbol
« Reply #4 on: December 02, 2019, 12:34:45 pm »
attaching 2 screenshots

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2388
  • Hero Points: 133
Re: relocation R_X86_64_PC32 against symbol
« Reply #5 on: December 02, 2019, 12:37:27 pm »
Can you select the appropriate radio button and show the specific build command?

aos

  • Community Member
  • Posts: 13
  • Hero Points: 0
Re: relocation R_X86_64_PC32 against symbol
« Reply #6 on: December 02, 2019, 01:07:53 pm »
Thanks, eventually it was solved by upgrading the g++ to g++-8...