1 2 Previous Next 18 Replies Latest reply on Aug 1, 2017 7:06 AM by Fedor-Oracle

    linking problem with compiler in 12.6 release

    userCIP

      Hello,

       

      we just switch to productive developer studio 12.6 release and compiled all internal code. We observed a strange linking behaviour...

       

      Perhaps someone can help and bring some light into the darkness !

       

      thanks,

       

      Christian and team

       

      ... here is the relevant compile sequence ...

       

      Step 1:

      Linking the Program Msb_fuell with Library liballgmessw.a:

       

      1/29. Linking with 1 libs : /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a

      (+ Lib /Entw/SOL126C14/Entw/lib/libs1db.a)

       

      Undefined first referenced

      symbol in file

      hole_globals(int, char**) Msb_fuell.o

      Hkm::CppDbc::SqlOrderBy::~SqlOrderBy() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      typeinfo for TransactionImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      RefCountPtrBase<Hkm::CppDbc::DbCursor>::mPtrMap /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbCursor>::mPtrMap must be defined in the program]

       

      operator<<(std::ostream &, const DataSourceImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Hkm::CppDbc::SqlSelect::~SqlSelect() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_delete(smod_info*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_leer(smod_info*, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Hkm::CppDbc::SqlGroupBy::~SqlGroupBy() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceFactory<DataSourceImpl>::create(const std::string &, const TransactionConcurrency&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      satzart(const char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlWhere /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlWhere must be defined in the program]

       

      RefCountPtrBase<Hkm::CppDbc::DbCursor>::mNullImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbCursor>::mNullImpl must be defined in the program]

       

      eprotokoll(const char*, short, const char*, short) Msb_fuell.o

      ResourceManager<DataSourceImpl>::normalizeId(const std::string &) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<TransactionImpl>::promote(TransactionImpl&, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      DataSourceImpl::GLOBAL_TRANSACTION_ID /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member DataSourceImpl::GLOBAL_TRANSACTION_ID must be defined in the program]

       

      Hkm::CppDbc::SqlHaving::~SqlHaving() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlOrderBy /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlOrderBy must be defined in the program]

       

      db_oeffne(const char*, short) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlGroupBy /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlGroupBy must be defined in the program]

       

      ResourceManager<TransactionImpl>::getRankOf(const TransactionImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Hkm::CppDbc::SqlIntoTemp::~SqlIntoTemp() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<DataSourceImpl>::getRankOf(const DataSourceImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlSelect /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlSelect must be defined in the program]

       

      key_sql(short, short, short, short, char**, char**, char**, char*, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlFrom /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlFrom must be defined in the program]

       

      ResourceManager<TransactionImpl>::normalizeId(const std::string &) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mNullImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mNullImpl must be defined in the program]

       

      Hkm::CppDbc::SqlWhere::~SqlWhere() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Transaction::select(const Hkm::CppDbc::DbQuery&, int)const /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlIntoTemp /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlIntoTemp must be defined in the program]

       

      Hkm::CppDbc::SqlFrom::~SqlFrom() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      TransactionImpl::TransactionImpl(const std::string &, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::DbSelect /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::DbSelect must be defined in the program]

       

      emeldung(const char*, short, short, const char*, ...) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_write(smod_info*, char*, char*, short)       /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      cnf_fuell(void*, void*, short, short, short, short, const char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      global2 Msb_fuell.o

      globals /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      nil_sprintf(const char*, char*, const char*, ...) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<TransactionImpl>::isAllowedPromotion(const TransactionImpl&, const TransactionIsolation&, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_read(smod_info*, short, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      fproto(const char*, const char*, const char*, long, short) /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mPtrMap /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mPtrMap must be defined in the program]

       

      mod_key_upd(smod_info*, char*, char*)     /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      operator<<(std::ostream &, const TransactionImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlHaving /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlHaving must be defined in the program]

       

      ld: fatal: symbol referencing errors

       

      Step 2:

      Now, if we link with one more Library (liballgmessw.a), the Module Archimed.o from liballgmessw.a is linked, though none of the symbols needed can be found in Archimed.o :

       

      2/29. Linking with 2 libs : /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a /Entw/SOL126C14/Entw/lib/liballgmessw.a

      (+ Lib /Entw/SOL126C14/Entw/lib/liballgmessw.a)

       

      Undefined first referenced

      symbol in file

      hole_globals(int, char**) Msb_fuell.o

      Hkm::CppDbc::SqlOrderBy::~SqlOrderBy() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      typeinfo for TransactionImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      RefCountPtrBase<Hkm::CppDbc::DbCursor>::mPtrMap /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbCursor>::mPtrMap must be defined in the program]

       

      operator<<(std::ostream &, const DataSourceImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Poco::RegularExpression::~RegularExpression() /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      Hkm::CppDbc::SqlSelect::~SqlSelect() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_delete(smod_info*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      mod_leer(smod_info*, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Hkm::CppDbc::SqlGroupBy::~SqlGroupBy() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      hkmDebugPrintf(__FILE*, const char*, long, const char*) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      ResourceFactory<DataSourceImpl>::create(const std::string &, const TransactionConcurrency&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      satzart(const char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      konvzt_ic(short, long, short, short*, char*) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      hkmDebugPrintf(__FILE*, const char*, std::string, const char*) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      vtable for Hkm::CppDbc::SqlWhere /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlWhere must be defined in the program]

       

      RefCountPtrBase<Hkm::CppDbc::DbCursor>::mNullImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbCursor>::mNullImpl must be defined in the program]

       

      eprotokoll(const char*, short, const char*, short) Msb_fuell.o

      ResourceManager<DataSourceImpl>::normalizeId(const std::string &) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<TransactionImpl>::promote(TransactionImpl&, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      DataSourceImpl::GLOBAL_TRANSACTION_ID /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member DataSourceImpl::GLOBAL_TRANSACTION_ID must be defined in the program]

       

      Hkm::CppDbc::SqlHaving::~SqlHaving() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      dbfile /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      Poco::RegularExpression::RegularExpression(const std::string &, int, bool) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      vtable for Hkm::CppDbc::SqlOrderBy /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlOrderBy must be defined in the program]

       

      db_oeffne(const char*, short) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlGroupBy /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlGroupBy must be defined in the program]

       

      ResourceManager<TransactionImpl>::getRankOf(const TransactionImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Hkm::CppDbc::SqlIntoTemp::~SqlIntoTemp() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<DataSourceImpl>::getRankOf(const DataSourceImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlSelect /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlSelect must be defined in the program]

       

      key_sql(short, short, short, short, char**, char**, char**, char*, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      hkm::archimed::mischerPfannen_g /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      [Hint: static member hkm::archimed::mischerPfannen_g must be defined in the program]

       

      vtable for Hkm::CppDbc::SqlFrom /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlFrom must be defined in the program]

       

      ResourceManager<TransactionImpl>::normalizeId(const std::string &) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mNullImpl /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mNullImpl must be defined in the program]

       

      Hkm::CppDbc::SqlWhere::~SqlWhere() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Transaction::select(const Hkm::CppDbc::DbQuery&, int)const /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlIntoTemp /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlIntoTemp must be defined in the program]

       

      Poco::Bugcheck::assertion(const char*, const char*, int, const char*) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      Hkm::CppDbc::SqlFrom::~SqlFrom() /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      hkm::archimed::i_informix_g /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      [Hint: static member hkm::archimed::i_informix_g must be defined in the program]

       

      TransactionImpl::TransactionImpl(const std::string &, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      zt2ascii(short, long) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      vtable for Hkm::CppDbc::DbSelect /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::DbSelect must be defined in the program]

       

      emeldung(const char*, short, short, const char*, ...) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      Poco::RegularExpression::match(const std::string &, unsigned int)const /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      mod_write(smod_info*, char*, char*, short) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      cnf_fuell(void*, void*, short, short, short, short, const char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      aes5(long) /Entw/SOL126C14/Entw/lib/liballgmessw.a(Archimed.o)

      global2 Msb_fuell.o

      globals /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      nil_sprintf(const char*, char*, const char*, ...) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      ResourceManager<TransactionImpl>::isAllowedPromotion(const TransactionImpl&, const TransactionIsolation&, const TransactionIsolation&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      mod_read(smod_info*, short, char*) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      fproto(const char*, const char*, const char*, long, short) /Entw/SOL126C14/Entw/lib/libs1db.a(msb_cnf_fuel.o)

      RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mPtrMap /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member RefCountPtrBase<Hkm::CppDbc::DbAccessManager>::mPtrMap must be defined in the program]

       

      mod_key_upd(smod_info*, char*, char*)     /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      operator<<(std::ostream &, const TransactionImpl&) /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      vtable for Hkm::CppDbc::SqlHaving /Entw/SOL126C14/Entw/lib/libs1db.a(msb.o)

      [Hint: static member vtable for Hkm::CppDbc::SqlHaving must be defined in the program]

       

      Remark:

      Here is a list of Modules in liballgmessw.a:

      rein@er200:~: ar -tv /Entw/SOL126C14/Entw/lib/liballgmessw.a

      rw-rw-r-- 560/  30021829512 Jul 19 14:44 2017 AllMstList.o

      rw-rw-r-- 560/  30021360232 Jul 19 14:45 2017 Archimed.o

      rw-rw-r-- 560/  3002 785588 Jul 19 14:45 2017 Eventfenster.o

      rw-rw-r-- 560/  3002 449556 Jul 19 14:45 2017 Eventviewad.o

      rw-rw-r-- 560/  3002 615360 Jul 19 14:45 2017 FtjObj.o

      rw-rw-r-- 560/  3002 581420 Jul 19 14:45 2017 Messpunkt.o

      rw-rw-r-- 560/  3002 134640 Jul 19 14:45 2017 Messstelle.o

      rw-rw-r-- 560/  3002 583252 Jul 19 14:45 2017 MischerPfanne.o

      rw-rw-r-- 560/  3002 862684 Jul 19 14:45 2017 MstList.o

      rw-rw-r-- 560/  30021744924 Jul 19 14:46 2017 MstObj.o

      rw-rw-r-- 560/  3002 580476 Jul 19 14:46 2017 MstZeiten.o

      rw-rw-r-- 560/  3002 711220 Jul 19 14:46 2017 Produkt.o

      rw-rw-r-- 560/  30021476452 Jul 19 14:46 2017 Produktdaten.o

      rw-rw-r-- 560/  30021336692 Jul 19 14:46 2017 SchmelzDaten.o

      rw-rw-r-- 560/  3002 636216 Jul 19 14:46 2017 Schmelze.o

      rw-rw-r-- 560/  3002 605780 Jul 19 14:46 2017 allgmessw.o

      rw-rw-r-- 560/  3002 105440 Jul 19 14:46 2017 allgmesswrpc.o

      rw-rw-r-- 560/  3002  94592 Jul 19 14:47 2017 catch_event.o

      rw-rw-r-- 560/  3002 300860 Jul 19 14:47 2017 messw2plot.o

      rw-rw-r-- 560/  3002  90672 Jul 19 14:47 2017 messw2zyklus.o

      rw-rw-r-- 560/  3002  99624 Jul 19 14:47 2017 messw_prot.o

      rw-rw-r-- 560/  3002  15532 Jul 19 14:47 2017 mw_remote_clnt.o

      rw-rw-r-- 560/  3002  15444 Jul 19 14:47 2017 mw_remote_xdr.o

       

      If we remove Archimed.o from liballgmessw.a , another Module ist linked instead (FtjObj.o) …

       

      If we remove liballgmessw.a from the LinkList, Msb_fuell can be linked completely:

       

      /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a  /Entw/SOL126C14/Entw/lib/liballgdbC.a /Entw/SOL126C14/Entw/lib/liballgdb.a /Entw/SOL126C14/Entw/lib/liballgec.a /Entw/SOL126C14/Entw/lib/liballgutilC.a /Entw/SOL126C14/Entw/lib/liballgrkop.a /Entw/SOL126C14/Entw/lib/liballgsock.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/lib/liballgsys.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifsql.a /Entw/SOL126C14/Entw/informix/lib/libifasf.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgls.a /Entw/SOL126C14/Entw/poco/lib/libPocoNet.a /Entw/SOL126C14/Entw/poco/lib/libPocoUtil.a /Entw/SOL126C14/Entw/poco/lib/libPocoJSON.a /Entw/SOL126C14/Entw/poco/lib/libPocoXML.a /Entw/SOL126C14/Entw/poco/lib/libPocoFoundation.a /Entw/SOL126C14/Entw/xerces.2.8.0/lib/libxerces-c.a -ldl -lgen -lsocket -lnsl -lm

       

      Remark:

      The symbol-list of liballgmessw.a can be found in the file liballgmessw_symbols.txt.

       

      Our Question:

      Why does the Linker link Archimed.o to Msb_fuell ? We can't see any Symbol in Archimed.o, which is needed by Msb_fuell…

        • 1. Re: linking problem with compiler in 12.6 release
          Steve.Clamage-Oracle

          It's possible you are seeing a bug in Studio 12.6 C++, but it's also possible that errors in your code, as indicated by the hints in the error messages, are the cause of the failure. Let's see what we can rule out:

           

          Did you recompile everything when you switched compilers? If you linked some previously-compiled binaries, try recompiling with Studio 12.6. (There have been some changes in what inline functions and static class data members get generated out of line.)

           

          Did your code work with a previous Studio compiler? Or is this the first Studio compiler you have used?

           

          If the code worked with a previous Studio compiler, have you made changes in the code or makefiles (other than changing the path to the compiler)? If you have the original code that previously worked, see if it also works with Studio 12.6. You can also try compiling the new code with the old compiler, if you are not actually using C++14 features.

          • 2. Re: linking problem with compiler in 12.6 release
            TomVonHKM

            Hello Steve,

             

            I'm a teammate of userCIP.

            In the case above we recompile the whole code every night, so everything is compiled with Studio 12.6 C++ with the same Options.

            The code and makefiles aren't changed and it works actually with the Compilers 12.5 and 12.3 .

            Remark: in May 2017 we compiled the code successfully with Studio C++ 12.6 beta ...

            • 3. Re: linking problem with compiler in 12.6 release
              Fedor-Oracle

              > Why does the Linker link Archimed.o to Msb_fuell

              This is strange, indeed.

              I dont see anything in your command line that would imply --whole-archive behavior so there must be a reference to some symbol from Archimed.o somewhere.

              Can you post output of your link line with -# added (i.e. CC ... -# 2>&1 | grep bin/ld) just to check that there is no --whole-archive hidden in it?

               

              regards,

                Fedor.

              • 4. Re: linking problem with compiler in 12.6 release
                Steve.Clamage-Oracle

                Adding to Fedor's comments:

                We seem to have two different issues:

                • Missing symbols at link time that could be due to a compiler bug.
                • Strange linker behavior.

                If there is no option causing the whole archive to be pulled in, let's find out how symbols are resolved.

                In both your step 1 and step 2, set the environment variable

                    LD_DEBUG=bindings,symbols

                The linker will emit data showing where symbols are from and how they are resolved. Refer to

                https://docs.oracle.com/cd/E19683-01/816-1386/chapter3-33/index.html

                for details.

                • 5. Re: linking problem with compiler in 12.6 release
                  TomVonHKM

                  Hello,

                   

                  here is the Compilation-Command with -# :

                  er200 sysa /Entw/SOL126C14/s1/messw/main : cat ./xxx

                  /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -# -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a /Entw/SOL126C14/Entw/lib/liballgmessw.a  /Entw/SOL126C14/Entw/lib/liballgdbC.a /Entw/SOL126C14/Entw/lib/liballgdb.a /Entw/SOL126C14/Entw/lib/liballgec.a /Entw/SOL126C14/Entw/lib/liballgutilC.a /Entw/SOL126C14/Entw/lib/liballgrkop.a /Entw/SOL126C14/Entw/lib/liballgsock.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/lib/liballgsys.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifsql.a /Entw/SOL126C14/Entw/informix/lib/libifasf.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgls.a   /Entw/SOL126C14/Entw/poco/lib/libPocoNet.a /Entw/SOL126C14/Entw/poco/lib/libPocoUtil.a /Entw/SOL126C14/Entw/poco/lib/libPocoJSON.a /Entw/SOL126C14/Entw/poco/lib/libPocoXML.a /Entw/SOL126C14/Entw/poco/lib/libPocoFoundation.a /Entw/SOL126C14/Entw/xerces.2.8.0/lib/libxerces-c.a -ldl -lgen -lsocket -lnsl -lm

                   

                  and here is the Output:

                  ./xxx 2>&1|grep /bin/ld

                  /usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1500877666.4005.01/libldstab_ws.so -zld64=-S/tmp/lib_link.1500877666.4005.01/sparcv9/libldstab_ws.so -zld32=-S/tmp/lib_link.1500877666.4005.01/libld_annotate.so -zld64=-S/tmp/lib_link.1500877666.4005.01/sparcv9/libld_annotate.so -zld32=-S/tmp/lib_link.1500877666.4005.01/libCCexcept.so.1 -zld64=-S/tmp/lib_link.1500877666.4005.01/sparcv9/libCCexcept.so.1 /opt/developerstudio12.6/lib/compilers/crti.o /opt/developerstudio12.6/lib/compilers/CCgrti.o /opt/developerstudio12.6/lib/compilers/crt1.o /opt/developerstudio12.6/lib/compilers/misalign.o /opt/developerstudio12.6/lib/compilers/values-xa.o -M /opt/developerstudio12.6/lib/compilers/CC-gcc/gcc_version.map Msb_fuell.o /Entw/SOL126C14/Entw/lib/libs1db.a /Entw/SOL126C14/Entw/lib/liballgmessw.a /Entw/SOL126C14/Entw/lib/liballgdbC.a /Entw/SOL126C14/Entw/lib/liballgdb.a /Entw/SOL126C14/Entw/lib/liballgec.a /Entw/SOL126C14/Entw/lib/liballgutilC.a /Entw/SOL126C14/Entw/lib/liballgrkop.a /Entw/SOL126C14/Entw/lib/liballgsock.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/lib/liballgsys.a /Entw/SOL126C14/Entw/lib/liballgmod.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifsql.a /Entw/SOL126C14/Entw/informix/lib/libifasf.a /Entw/SOL126C14/Entw/informix/lib/esql/libifos.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgen.a /Entw/SOL126C14/Entw/informix/lib/esql/libifgls.a /Entw/SOL126C14/Entw/poco/lib/libPocoNet.a /Entw/SOL126C14/Entw/poco/lib/libPocoUtil.a /Entw/SOL126C14/Entw/poco/lib/libPocoJSON.a /Entw/SOL126C14/Entw/poco/lib/libPocoXML.a /Entw/SOL126C14/Entw/poco/lib/libPocoFoundation.a /Entw/SOL126C14/Entw/xerces.2.8.0/lib/libxerces-c.a -ldl -lgen -lsocket -lnsl -lm -o /Entw/SOL126C14/s1/messw/main/Msb_fuell -Y "P,/opt/developerstudio12.6/lib/compilers/sparcvis2:/opt/developerstudio12.6/lib/compilers:/opt/developerstudio12.6/lib:/usr/ccs/lib:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib:/lib:/usr/lib" -Qy "-R/opt/developerstudio12.6/lib:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib:/opt/developerstudio12.6/lib/compilers/atomic" -lstdc++ -lgcc_s /opt/developerstudio12.6/lib/compilers/atomic/libstatomic.so.1 -lCrunG3 -lrt -lm -lc /opt/developerstudio12.6/lib/compilers/CCgrtn.o /opt/developerstudio12.6/lib/compilers/crtn.o 2> /tmp/ld.1500877666.4005.02.err

                   

                  I can't see a -whole-archive switch...

                   

                  Best regards

                      Tom

                  • 6. Re: linking problem with compiler in 12.6 release
                    TomVonHKM

                    Hello Steve,

                    I'm not sure I fully understood, what to do, but here it is:

                     

                    Step1:

                    LD_DEBUG=bindings,symbols /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a

                    (See the output in the step1-Files.)

                     

                    Step2:

                    LD_DEBUG=bindings,symbols /opt/developerstudio12.6/bin/CC -o /Entw/SOL126C14/s1/messw/main/Msb_fuell Msb_fuell.o -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 /Entw/SOL126C14/Entw/lib/libs1db.a /Entw/SOL126C14/Entw/lib/liballgmessw.a

                    (See the output in the step2-Files)

                     

                    I can't see any of our symbols from liballgmessw.a or libs1db.a. Is it because we use static binding for our libraries ?

                    In the output-Files only symbols from shared libraries are logged…

                     

                    Because I have no upload-Button, UserCip will upload the files ...

                     

                    Best regards,

                        Tom

                    • 7. Re: linking problem with compiler in 12.6 release
                      userCIP

                      Hi Steve,

                       

                      Tom asked for upload essential files ...

                       

                      Christian

                      • 8. Re: linking problem with compiler in 12.6 release
                        Steve.Clamage-Oracle

                        The idea was to compare resolution of, for example, the symbol Msb_fuell with and without linking the archive file, by getting the linker debug output. I expected one linker output file for step 1 and one for step2. I don't understand why there are 12 files. In any case, the symbol Msb_fuell is not in any of the linker output files, so we didn't really learn anything.


                        The main problem, failed link due to missing program symbols, might be a compiler bug, but it also could be user error. That is, something about the code or the way it is built that worked only by accident with older compilers. If you can provide a test case that shows similar missing symbols at link time, we can investigate.

                        • 9. Re: linking problem with compiler in 12.6 release
                          TomVonHKM

                          Hello Steve,

                           

                          I stripped down my Module Archimed.o to a minimal Set of Code to see, which symbol leads to binding Archimed.o to Msb_fuell.

                          Here are my 2 Versions (A working, B not working) of the Code:

                           

                          A: Archimed.C working NOT like expected (bound to Msb_fuell):

                             1 #include <string>

                            2 #include <sstream>

                            3 extern int dummy;

                            4

                            5 void i_open_outfile(std::string outfile, bool& close_file) {

                            6 dummy=0; // just to see if this Module is binded into Msb_fuell(undefined symbol)

                            7 std::stringstream prot;

                            8 //prot << "bla"; // --- ok

                            9    prot << outfile;  // --- not ok

                          10 }

                          //--> Archimed is bound to Msb_fuell (with undefined symbol dummy)

                           

                          B: Archimed.C working like expected (not bound to Msb_fuell):

                            1 #include <string>

                            2 #include <sstream>

                            3 extern int dummy;

                            4

                            5 void i_open_outfile(std::string outfile, bool& close_file) {

                            6 dummy=0; // just to see if this Module is binded into Msb_fuell(undefined symbol)

                            7 std::stringstream prot;

                            8    prot << "bla";  // --- ok

                            9 //prot << outfile;  // --- not ok

                          10 }

                          //--> Archimed is not bound to Msb_fuell, Msb_fuell is bound complete without errors.

                           

                          Here is the compilation command: /opt/developerstudio12.6/bin/CC -c -o /Entw/git/SOL126C14/rein/allg_messw/lib/Archimed.o -DINFORMIX  -DINFORMIX -DSOLARIS_VERSION=113 -DSVR4 -DSYSV -Dsolaris -erroff=hidef,hidevf -errwarn=%all -errwarn=no%wnoretvalue -g0 -mt -std=c++14 -I/Entw/git/SRC/rein/allg_messw/incl  -I/Entw/git/SRC/rein/allg_messw/incl   -I/Entw/SOL126C14/Entw/include/allg/autoconv -I/Entw/SOL126C14/Entw/include/allg -I/Entw/SRC/Entw/include/allg/autoconv -I/Entw/SRC/Entw/include/allg/ -I/Entw/SRC/Entw/include/allg  -I/Entw/SOL126C14/Entw/include/autoconv -I/Entw/SRC/Entw/include/autoconv -I/Entw/SOL126C14/Entw/include -I/Entw/SRC/Entw/include  -I/Entw/SOL126C14/Entw/boost -I/Entw/SOL126C14/Entw/informix/incl/esql  -I/Entw/SOL126C14/Entw/poco/include  /Entw/git/SRC/rein/allg_messw/lib/Archimed.C

                           

                           

                          As you see, the only Difference in the working example is exchanging Line 8 and 9.

                          Now I do an nm -C |grep GLOB|egrep -v UNDEF  with both Files:

                           

                          A:

                          [57]  | 0|         4|OBJT |GLOB |0    |3 |$XABAAA$KTydZFqI._ZL16__gthread_active

                          [56]  | 0|         1|OBJT |GLOB |0    |6 |$XABAAA$KTydZFqI._ZStL19piecewise_construct

                          [64]  | 16|        20|FUNC |GLOB |0    |11 |__gnu_cxx::new_allocator<char16_t>::~new_allocator()

                          [65]  | 16|        20|FUNC |GLOB |0    |11 |__gnu_cxx::new_allocator<char16_t>::~new_allocator()

                          [62]  | 16|        20|FUNC |GLOB |0    |10 |__gnu_cxx::new_allocator<char32_t>::~new_allocator()

                          [63]  | 16|        20|FUNC |GLOB |0    |10 |__gnu_cxx::new_allocator<char32_t>::~new_allocator()

                          [60]  | 16|        20|FUNC |GLOB |0    |9 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [61]  | 16|        20|FUNC |GLOB |0    |9 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [66]  | 16|        20|FUNC |GLOB |0    |12 |__gnu_cxx::new_allocator<wchar_t>::~new_allocator()

                          [67]  | 16|        20|FUNC |GLOB |0    |12 |__gnu_cxx::new_allocator<wchar_t>::~new_allocator()

                          [58]  | 64|       332|FUNC |GLOB |0    |2 |i_open_outfile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool&)

                          [59]  |        16|        40|FUNC |GLOB |0    |8 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                           

                          B:

                          [51]  | 0|         4|OBJT |GLOB |0    |3 |$XABAAA$PUydZVvR._ZL16__gthread_active

                          [50]  | 0|         1|OBJT |GLOB |0    |6 |$XABAAA$PUydZVvR._ZStL19piecewise_construct

                          [57]  | 16|        20|FUNC |GLOB |0    |10 |__gnu_cxx::new_allocator<char16_t>::~new_allocator()

                          [58]  | 16|        20|FUNC |GLOB |0    |10 |__gnu_cxx::new_allocator<char16_t>::~new_allocator()

                          [55]  | 16|        20|FUNC |GLOB |0    |9 |__gnu_cxx::new_allocator<char32_t>::~new_allocator()

                          [56]  | 16|        20|FUNC |GLOB |0    |9 |__gnu_cxx::new_allocator<char32_t>::~new_allocator()

                          [53]  | 16|        20|FUNC |GLOB |0    |8 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [54]  | 16|        20|FUNC |GLOB |0    |8 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [59]  | 16|        20|FUNC |GLOB |0    |11 |__gnu_cxx::new_allocator<wchar_t>::~new_allocator()

                          [60]  | 16|        20|FUNC |GLOB |0    |11 |__gnu_cxx::new_allocator<wchar_t>::~new_allocator()

                          [52]  | 64|       380|FUNC |GLOB |0    |2 |i_open_outfile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool&)

                           

                          The only difference is the bold line [59] with ::data()const

                           

                          So here is my golden question:

                          Is it a Compiler-Error, that the symbol *::data()const is global visible and defined in Archimed.o or did I make any mistake?

                           

                           

                          Addition:

                          When I compile Version A with Compiler 12.6beta, I get the following nm -C Output:

                           

                          [548] |       576|        32|OBJT |GLOB |0    |3 |$XDBAAA$WAzdZlVK._ZZL18__gthread_active_pvEL21__gthread_active_once

                          [547] |       552|        24|OBJT |GLOB |0    |3 |$XDBAAA$WAzdZlVK._ZZL18__gthread_active_pvEL22__gthread_active_mutex

                          [512] |        16|        20|FUNC |GLOB |0    |46 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [513] |        16|        20|FUNC |GLOB |0    |46 |__gnu_cxx::new_allocator<char>::~new_allocator()

                          [448] |        64|       332|FUNC |GLOB |0    |2 |i_open_outfile(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool&)

                          [457] |        16|        20|FUNC |GLOB |0    |18 |std::allocator<char>::allocator()

                          [458] |        16|        20|FUNC |GLOB |0    |18 |std::allocator<char>::allocator()

                          [510] |        16|        28|FUNC |GLOB |0    |45 |std::allocator<char>::allocator(const std::allocator<char>&)

                          [511] |        16|        28|FUNC |GLOB |0    |45 |std::allocator<char>::allocator(const std::allocator<char>&)

                          [499] |        16|        20|FUNC |GLOB |0    |29 |std::allocator<char>::~allocator()

                          [500] |        16|        20|FUNC |GLOB |0    |29 |std::allocator<char>::~allocator()

                          [491] |        16|       108|FUNC |GLOB |0    |26 |std::basic_ios<char, std::char_traits<char> >::basic_ios()

                          [496] |        16|       108|FUNC |GLOB |0    |26 |std::basic_ios<char, std::char_traits<char> >::basic_ios()

                          [480] |        16|       460|FUNC |GLOB |0    |22 |std::basic_iostream<char, std::char_traits<char> >::basic_iostream()

                          [490] |        16|       392|FUNC |GLOB |0    |24 |std::basic_iostream<char, std::char_traits<char> >::basic_iostream()

                          [462] |        16|       104|FUNC |GLOB |0    |21 |std::basic_streambuf<char, std::char_traits<char> >::basic_streambuf()

                          [479] |        16|       104|FUNC |GLOB |0    |21 |std::basic_streambuf<char, std::char_traits<char> >::basic_streambuf()

                          [554] |        16|        36|FUNC |GLOB |0    |85 |std::basic_streambuf<char, std::char_traits<char> >::eback()const

                          [556] |        16|        36|FUNC |GLOB |0    |87 |std::basic_streambuf<char, std::char_traits<char> >::egptr()const

                          [553] |        16|        36|FUNC |GLOB |0    |84 |std::basic_streambuf<char, std::char_traits<char> >::gptr()const

                          [557] |        16|        36|FUNC |GLOB |0    |88 |std::basic_streambuf<char, std::char_traits<char> >::pptr()const

                          [555] |        16|        80|FUNC |GLOB |0    |86 |std::basic_streambuf<char, std::char_traits<char> >::setg(char*, char*, char*)

                          [460] |        16|        64|FUNC |GLOB |0    |20 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, const std::allocator<char>&)

                          [461] |        16|        64|FUNC |GLOB |0    |20 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, const std::allocator<char>&)

                          [509] |        16|        20|FUNC |GLOB |0    |44 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::~_Alloc_hider()

                          [552] |        16|       392|FUNC |GLOB |0    |82 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_dispose(const std::allocator<char>&)

                          [459] |        16|        36|FUNC |GLOB |0    |19 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_M_refdata()

                          [453] |        16|        40|FUNC |GLOB |0    |13 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                          [551] |        16|        56|FUNC |GLOB |0    |81 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::get_allocator()const

                          [452] |        16|        52|FUNC |GLOB |0    |12 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size()const

                          [501] |        16|       452|FUNC |GLOB |0    |30 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()

                          [502] |        16|       452|FUNC |GLOB |0    |30 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()

                          [503] |        16|       392|FUNC |GLOB |0    |32 |std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::~basic_stringbuf()

                          [454] |        16|       576|FUNC |GLOB |0    |14 |std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)

                          [455] |        16|       512|FUNC |GLOB |0    |16 |std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(std::_Ios_Openmode)

                           

                          here I find much more global defined symbols... 

                          Best regards,

                             Tom

                          • 10. Re: linking problem with compiler in 12.6 release
                            Steve.Clamage-Oracle

                            I turned your sample code into a complete program by adding a main function:

                             

                            #include <string>

                            #include <sstream>

                            extern int dummy;

                            void i_open_outfile(std::string outfile, bool& close_file)

                            {

                                dummy=0;

                                std::stringstream prot;

                                prot << outfile;

                            }

                            int main()

                            {

                                std::string s = "hello";

                                bool b = true;

                                i_open_outfile(s, b);

                            }


                            This program will not link, because "dummy" is not defined. If this file is part of a larger program, a binary presented on the command line that defines a symbol "dummy" will be pulled in by the linker. Perhaps that is the effect you are seeing: An undefined symbol pulled in a binary that otherwise would not have been used, contributing more symbols, some of which are not satisfied by the libraries being linked.

                             

                            If you create a definition of dummy by removing "extern" from its declaration, or delete all uses of dummy, the program links successfully.

                             

                            Does this description help?

                            • 11. Re: linking problem with compiler in 12.6 release
                              TomVonHKM

                              Hello Steve,

                               

                              sorry, but I think you did not really understand our problem.

                              Our main problem is: some modules (in this case Archimed.o), which are not really needed my a main program, are linked into this main program.

                              At the first sight this isn't a big problem, but you have to link all symbols, which are needed by Archimed.o too. If Archimed.o needs an extern int dummy, you have to declare this extern variable in the main program, even if you know per 100 % , that you don't need it.

                              Therefore I put the extern variable dummy in my example code, to see quickly, if Archimed.o ist linked into Msb_fuell (in ths case it produces an error "undefined symbol dummy").

                              The main problem seem to me, that in some cases the inline code of string::data() ist sometimes compiled into modules as GLOB and UNDEF, and in some cases as GLOB with a real representation of the code.

                              In Compiler 12.6b string::data() (and also Compiler 12.5) was alway compiled as an GLOBAL and existing symbol:

                              [1977]  |   16|   40|FUNC |GLOB |0|64 |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                              but in some cases (here msb.o) it is GLOB and UNDEF :

                              [1860]  |    0|    0|FUNC |GLOB |0|UNDEF |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                              with Compiler 12.5 or 12.6b it looks linke :

                              [2333]  |   16|   44|FUNC |GLOB |0|277|std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                               

                              In my case the linkage chain is :

                              12.6: My main Msb_fuell.o needs msb.o, msb.o needs Archimed.o (which isn't really needed, only because of ::data()), and Archimed.o needs a lot of (really not needed) stuff.

                              pre 12.6: My main Msb_fuell.o needs msb.o, msb.o needs a few other modules(not Archimed.o), ready !

                               

                              I hope I could explain my problem to you.

                               

                              Best regards

                                 Tom

                              • 12. Re: linking problem with compiler in 12.6 release
                                Steve.Clamage-Oracle

                                Thanks for the added explanation.

                                 

                                The std::string::data function is defined as an inline function in standard header <string>. Whether an inline function is generated as an out-of-line (actual) function in a .o file depends on several factors, but in (almost) no case should a .o file have an UNDEF reference to the function if header <string> is included.

                                 

                                There is one case where an UNDEF reference would be generated. If you use the option -instances=extern, out-of-line inline functions are generated in the template cache, not in the ..o file, and the .o file can have an UNDEF reference to such functions. I didn't see this option being used ,and we recommend against using -instances=extern unless you have a specific need for it. (The option can reduce the total amount of disk space needed during program build, and sometimes reduce the size of libraries.)

                                 

                                So we have three possibilities, listed from least likely to most likely:

                                 

                                3. The option -instances=extern is being used. If so, remove it from scripts and makefiles, and rebuild everything.

                                 

                                2. The source code somehow manages to refer to function std::string::data without including header <string>. Failure to include <string> would be a user error, so be sure the include directive is present in source code that winds up with UNDEF references to std:;string::data.

                                 

                                1. Compiler bug. This exact problem has not shown up in the extensive testing we do, but we have found somewhat similar cases. Can you provide a compilable example that results in an UNDEF std:;string::data?

                                • 13. Re: linking problem with compiler in 12.6 release
                                  TomVonHKM

                                  Hello Steve,

                                  I think were getting closer to the Problem:

                                  3. we don't use the optin -instances=extern

                                  2. in our code, where we see the problem, the headerfile <string> is included

                                  1. I grep'ed through our librarys, to find all modules with an UNDEF std::string::data(). When I looked into their sourcecodes, I found out, that alway a map of strings was unsed. So I wrote a litte testprogram with a simple map of strings, and it has the same UNDEF std::string::data() !(STRIKE)

                                   

                                  Here is the code:

                                  cat msbarch.C :

                                  #include <string>

                                  #include <map>

                                   

                                  int main(int argc, const char *argv[]) {

                                     std::string a("a");

                                     std::string b("b");

                                     std::map< std::string,std::string> mymap;

                                     mymap [a] = b;

                                     return 0;

                                  }

                                   

                                  compile it with:

                                  /opt/developerstudio12.6/bin/CC -c msbarch.C -o msbarch.o -DSVR4 -DSYSV -Dsolaris -errwarn=%all -g0 -mt -std=c++14

                                   

                                  and check the result:

                                  nm -C msbarch.o|grep ::data

                                  [282]   |         0|         0|FUNC |GLOB |0    |UNDEF  |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                                   

                                  so I think we detected a compiler-bug ... ?!

                                   

                                  Addition:

                                  the result with Compiler 12.6beta:

                                  nm -C /Entw/git/SOL126BC14/rein/allg_messw/test/msbarch.o|grep ::data

                                  [312]   |        16|        40|FUNC |GLOB |0    |18     |std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data()const

                                   

                                   

                                  Best regards,

                                     Tom

                                  • 14. Re: linking problem with compiler in 12.6 release
                                    Fedor-Oracle

                                    Thanks for the reproducer.

                                     

                                    Inliner fails to inline basic_string::data and then compiler fails to generate the body:

                                    ] CC msbarch.cc  -std=c++11  -W0,-Xinl 2>&1 | grep string::data

                                    std::string::data() const not inlined because of size limit exceeded

                                    std::string::data() const not inlined because of size limit exceeded

                                    ]

                                     

                                    The only workaround is to disable inlining by using -g instead of -g0.

                                     

                                    regards,

                                      Fedor.

                                    1 2 Previous Next