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

aos

  • Community Member
  • Posts: 22
  • 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: 2897
  • Hero Points: 153
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: 22
  • 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: 2897
  • Hero Points: 153
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: 22
  • 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: 2897
  • Hero Points: 153
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: 22
  • 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...