Sun Solaris C++ Compiling Error

Hello. I'm using SunStudio 12 Update 1. When compiling for x86, everything works fine. When compiling for SPARC, I get the following errors. I linked libCstd.so.1 explicitly, but I get the same errors. Would anyone be kind enough to step me through resolving this? Thank you very much.

** Linking binary camaAlpha_Agw
CC -lrt -mt -xarch=v9 -DCOMPILE_SOL_SPARC -ftrap=%none -xlibmil  -xchip=ultra2 -xbuiltin -xO4 -D_REENTRANT -DNDEBUG
  -instances=static -I. -I/home/Alpha/release64/include -I/home/Alpha/release64/include  -I/home/Alpha/src/emapi/common
  -I/home/Alpha/src/emapi/emapi -o /home/Alpha/release64/obj/camaAlpha_Agw/CompileDate.o
CC -lrt -mt -xarch=v9 -DCOMPILE_SOL_SPARC -ftrap=%none -xlibmil  -xchip=ultra2 -xbuiltin -xO4 -D_REENTRANT -DNDEBUG
  -instances=static -I. -I/home/Alpha/release64/include -I/home/Alpha/release64/include  -I/home/Alpha/src/emapi/common
  -I/home/Alpha/src/emapi/emapi -xildoff -norunpath -lrt -o /home/Alpha/release64/bin/camaAlpha_Agw /home/Alpha/release64/obj/camaAlpha_Agw/AgwApp.o
  /home/Alpha/release64/obj/camaAlpha_Agw/AgwCallBack.o /home/Alpha/release64/obj/camaAlpha_Agw/AgwHealth.o
  /home/Alpha/release64/obj/camaAlpha_Agw/AgwLink.o /home/Alpha/release64/obj/camaAlpha_Agw/AgwMain.o
  /home/Alpha/release64/obj/camaAlpha_Agw/AgwMessageQueue.o /home/Alpha/release64/obj/camaAlpha_Agw/AgwSession.o
  /home/Alpha/release64/obj/camaAlpha_Agw/AgwSortString.o /home/Alpha/release64/obj/camaAlpha_Agw/AgwUtility.o \
        /home/Alpha/release64/obj/camaAlpha_Agw/CompileDate.o -L/home/Alpha/release64/lib -L/home/Alpha/src/emapi/lib/SOL_SPARC
  -lFidApp -lFidInf -lFidCore -lFidevm -lAlphaDb  -lemapi -ldl -lsocket -ldemangle -lm -lnsl -lz -lsched -R /usr/lib/lwp/64
Undefined                        first referenced
 symbol                              in file
unsigned long std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size()const
  /home/Alpha/src/emapi/lib/SOL_SPARC/libemapi.a(EmapiSessionImpl.o) 
  (symbol belongs to implicit dependency /usr/lib/sparcv9/libCstd.so.1)
void std::basic_string<char,std::char_traits<char>,std::allocator<char> >::clear()
  /home/Alpha/src/emapi/lib/SOL_SPARC/libemapi.a(MessageQueueItems.o)
  (symbol belongs to implicit dependency /usr/lib/sparcv9/libCstd.so.1)
char*__rwstd::__rw_basis<char*,std::allocator<char> >::data()const
  /home/Alpha/src/emapi/lib/SOL_SPARC/libemapi.a(EmapiTypes.o)
  (symbol belongs to implicit dependency /usr/lib/sparcv9/libCstd.so.1)
...
...
...
 

This might help you understand the problem: Sun Studio C++ - Linking Error : Undefined Symbols

1 Like

I emailed the system administrators to create the following symlinks, as suggested in the Sun Workshop[tm] 6 update 2 C++ Compiler Readme:

 
ln -s /usr/lib/libCstd.so.1 /opt/SUNWSpro/lib/libCstd.so
ln -s /usr/lib/libCstd.so.1 /opt/SUNWSpro/lib/v8plus/libCstd.so
ln -s /usr/lib/sparcv9/libCstd.so.1 /opt/SUNWSpro/lib/v9/libCstd.so