0

I'm having trouble linking with Pantheios on Linux with gcc4.6 with the following error:

In function `pantheios::internal::log_dispatch_3(int, unsigned int, char const*, unsigned int, char const*, unsigned int, char const*)':
sig_writing_sink.cpp:(.text._ZN9pantheios8internal14log_dispatch_3EijPKcjS2_jS2_[pantheios::internal::log_dispatch_3(int, unsigned int, char const*, unsigned int, char const*, unsigned int, char const*)]+0x6d): undefined reference to `pantheios_log_3_no_test'
collect2: ld returned 1 exit status

I'm linking with:

  • libpantheios.1.core.gcc46.mt.a
  • libpantheios.1.fe.simple.gcc46.mt.a
  • libpantheios.1.be.fprintf.gcc46.mt.a
  • libpantheios.1.bec.fprintf.gcc46.mt.a
  • libpantheios.1.util.gcc46.mt.a
  • libpantheios.1.appl.gcc46.mt.a
  • libpantheios.1.core.gcc46.mt.a

Where is pantheios_log_3_no_test?
What am I missing?

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137

1 Answers1

0

Turns out that in gcc, symbols are only linked forward, so dependent symbols in a given lib will only be resolved from the libs that follow it in the link list. See here for some more details.
By moving other statically linked libs to before Pantheios, the linker succeeded.

Community
  • 1
  • 1
Adi Shavit
  • 16,743
  • 5
  • 67
  • 137