3

I am trying to build an application for freebsd which links to a shared object "share.so" built on linux. I also have freebsd linux compatible libraries under /usr/compat/linux/lib. I am able to compile my application. But while linking to "share.so" I am getting bunch of errors as share.so(built on linux) needs to access libraries under "/usr/compat/linux/lib". Is there a way to tell share.so to look into compat linux directory instead of /usr/lib/

/usr/bin/ld: warning: libstdc++.so.6, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libm.so.6, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libgcc_s.so.1, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

/usr/bin/ld: warning: libpthread.so.0, needed by sharedlib.so, not found (try using -rpath or -rpath-link)

These are the warnings I am getting. These versions are available in compat/linux/lib where as the /usr/lib contains lower versions. Here sharedlib.so is the .so files generated on linux

Kamal
  • 3,068
  • 5
  • 26
  • 26
  • Please post your linker command (Makefile?) and any relevant errors – Sam Post Feb 24 '10 at 05:32
  • Hi Sam, I updated my question with the warnings I am getting. We actually have access to the source of sharedlib so we are compiling it for freebsd. But I would still like to know if you have any thoughts on how to get around this problem. for linking I am just giving path of the sharedlib -L /path/to/sharedlib. I also tried adding -L/usr/compat/linux/usr/lib to the command but it didn't work – Kamal Feb 26 '10 at 03:28

1 Answers1

3

You need to modify your loader configuration to tell it to look in that directory for libraries.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358