1

Folks,

I am writing a program on ubuntu which uses posix shared memory and semophores. I was trying to link directly to the onboard /usr/lib/x86_64-linux-gnu/librt.so however the shared object library isn't ABI compatible with my program. The precise linker error is as follows...

/usr/bin/ld: libopticalheadShMutils.a(shmutils.cpp.o): undefined reference to symbol 'sem_post@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Q, What do I need to do to consume this library? I'm thinking I need to compile an new non-system library from source - is this the right approach? Where is the best place to get the source code?

David McCabe
  • 107
  • 1
  • 8

1 Answers1

1

Finally solved it. i wasn't linking to the posix threads library which it turns out is required when using librt. In regards to the ABI incompatibility issue - the unix libraries should all be C89 and therefore compatible - I was wrong about this.

David McCabe
  • 107
  • 1
  • 8