2 Replies Latest reply: Sep 23, 2011 8:37 AM by 850528 RSS

    Undefined Reference to Constructor in Library

    850528
      Hi,

      I have a C++ library compiled with GCC and are trying to use with Solaris Studio. If I select the GNU toolset in Solaris Studio everything is fine however I use the Solaris Studio 12.2 Toolset I get following Error

      build/Debug/OracleSolarisStudio-Linux-x86/_ext/1445274692/main.o: In function `queryfolder::~queryfolder #Nvariant 1()':
      ../../src/queryfolder.h:47: undefined reference to `BamTools::BamReader::~BamReader()'
      ../../src/queryfolder.h:47: undefined reference to `BamTools::BamReader::~BamReader()'
      build/Debug/OracleSolarisStudio-Linux-x86/_ext/1445274692/novopaired_main.o: In function `queryfolder::queryfolder #Nvariant 1(novoparam&)':
      /wd5/sparks/NovoCraft/ssp/novoalign//../../src/queryfolder.h:40: undefined reference to `BamTools::BamReader::BamReader()'
      /wd5/sparks/NovoCraft/ssp/novoalign//../../src/queryfolder.h:44: undefined reference to `BamTools::BamReader::~BamReader()'


      f I run nm against the library (an archie) I get these two entries

      U _ZN8BamTools9BamReaderC1Ev
      U _ZN8BamTools9BamReaderD1Ev
      along with entries for other methods. I'm assuming these are the constructor & destructor.

      I'm wondering if I've hit some sort of name mangling issue between Sun C++ and GCC and how I might resolve this.

      Best Regards, Colin

      Edited by: 847525 on Sep 23, 2011 12:45 AM to add constructor error message