Undefined symbol: invalid_argument

Help
2007-08-21
2013-05-20
  • William Greene
    William Greene
    2007-08-21

    Hello all.

    I'm left scratching my head on this one.  I can compile log4cpp (0.3.5rc3) fine and dandy.  When I go to compile or more to the point link my application that uses log4cpp I get an undefined symbol.

    I'm developing on the latest OpenSolaris NV-B64A for SPARC.  I'm using the gcc2 2.95.3, REV=2005.01.04.  I'm porting an existing application from Red Hat Linux to Solaris and making some small modifications to it.

    Undefined                       first referenced
    symbol                             in file
    invalid_argument::invalid_argument(basic_string<char, string_char_traits<char>, __default_alloc_template<false, 0> > const &)../../imports/log4cpp/log4cpp-0.3.5rc3/.libs/liblog4cpp.a(Category.o)
    ld: fatal: Symbol referencing errors. No output written to serverpep
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `serverpep'

    rush[~/svn/serverpep/co/serverpep]> nm /opt/csw/gcc2/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstdc++.so |grep invalid_argument
    [1932]  |    289820|        24|FUNC |WEAK |0    |425    |_._16invalid_argument
    [1634]  |    290000|       176|FUNC |WEAK |0    |427    |__16invalid_argumentRCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0
    [2490]  |    289844|       156|FUNC |WEAK |0    |426    |__tf16invalid_argument
    [2574]  |    440712|        12|OBJT |GLOB |0    |893    |__ti16invalid_argument
    [2129]  |    436480|        32|OBJT |WEAK |0    |837    |_vt.16invalid_argument
    rush[~/svn/serverpep/co/serverpep]>

    Any help would be appreciated.
    Thanks,
    Bill

     
    • William Greene
      William Greene
      2007-08-23

      I switched from gcc2 to gcc3 and the problem went away.  I can't explain it. 

      The gcc3 version I'm using now is the one that is the default for OpenSolaris NV-B64A for SPARC.  The gcc2 was downloaded from blastwave.org.  Maybe it's not suitable for this version of install, although it's been working for months until I tried to use the log4cpp libraries.

      rush[/usr/sfw/lib]> nm libstdc++.a | grep invalid_argument
      [126]   |         0|         0|NOTY |GLOB |0    |UNDEF  |_ZNSt16invalid_argumentC1ERKSs
      [88]    |         0|        44|FUNC |WEAK |0    |34     |_ZNSt16invalid_argumentD0Ev
      [83]    |         0|        36|FUNC |WEAK |0    |33     |_ZNSt16invalid_argumentD1Ev
      [95]    |         0|       220|FUNC |GLOB |0    |53     |_ZSt24__throw_invalid_argumentPKc
      [140]   |         0|        12|OBJT |WEAK |0    |21     |_ZTISt16invalid_argument
      [134]   |         0|        21|OBJT |WEAK |0    |22     |_ZTSSt16invalid_argument
      [112]   |         0|        20|OBJT |WEAK |0    |23     |_ZTVSt16invalid_argument
      [132]   |         0|        36|FUNC |GLOB |0    |56     |_ZNSt16invalid_argumentC1ERKSs
      [161]   |         0|        36|FUNC |GLOB |0    |57     |_ZNSt16invalid_argumentC2ERKSs
      [101]   |         0|        44|FUNC |WEAK |0    |63     |_ZNSt16invalid_argumentD0Ev
      [96]    |         0|        36|FUNC |WEAK |0    |62     |_ZNSt16invalid_argumentD1Ev
      [148]   |         0|        12|OBJT |WEAK |0    |28     |_ZTISt16invalid_argument
      [140]   |         0|        21|OBJT |WEAK |0    |29     |_ZTSSt16invalid_argument
      [123]   |         0|        20|OBJT |WEAK |0    |27     |_ZTVSt16invalid_argument

      Oh well.  Perhaps this posting will help someone else in the future.

      Cheers,
      Bill