www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - undefined reference to `pantheios_log_3_no_test'

reply "Adi" <uknowme somewhere.com> writes:
Hi,

    I have a whole bunch of projects using Pantheios, but one of
them fails to link 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

Please advise,
Thanks,
Adi
Mar 10 2013
parent reply "Matt Wilson" <matthewwilson acm.org> writes:
Adi

Glad we sorted it out. Would you mind adding in details of the fix to the 
Pantheios Help forum, and then posting a link to that in this ng?

Thanks

Matt

"Adi" <uknowme somewhere.com> wrote in message 
news:mkmybpvctxqkzhrxyvdi forum.dlang.org...
 Hi,

    I have a whole bunch of projects using Pantheios, but one of
 them fails to link 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

 Please advise,
 Thanks,
 Adi 
Mar 14 2013
parent "Adi" <uknowme somewhere.com> writes:
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 
<http://stackoverflow.com/questions/45135/linker-order-gcc> for 
some more details.
By moving other statically linked libs to before Pantheios, the 
linker succeeded.
Thanks Matt!

ref:
- 
http://stackoverflow.com/questions/15321970/undefined-reference-to-pantheios-log-3-no-test
- 
https://sourceforge.net/projects/pantheios/forums/forum/475313/topic/6975104/index/page/1


On Friday, 15 March 2013 at 02:14:34 UTC, Matt Wilson wrote:
 Adi

 Glad we sorted it out. Would you mind adding in details of the 
 fix to the
 Pantheios Help forum, and then posting a link to that in this 
 ng?

 Thanks

 Matt

 "Adi" <uknowme somewhere.com> wrote in message
 news:mkmybpvctxqkzhrxyvdi forum.dlang.org...
 Hi,

    I have a whole bunch of projects using Pantheios, but one of
 them fails to link 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

 Please advise,
 Thanks,
 Adi
Mar 15 2013