C/C++

C/C++

C/C++

Your one-stop destination to learn and collaborate about the latest innovations in IBM C/C++ for z/OS compilers to develop high-performing C/C++ applications and system programs on z/OS while maximizing hardware use and improving application performance.

 View Only
  • 1.  Z/os C++ compilation Std::String function error

    Posted Thu November 23, 2017 07:15 AM

    Hello Everyone,

     

    I wanted to do a SUBSTR function in C++ to split out a particular string value like

    Var2=SUBSTR(var, start_pos,length);

    I found similar example to do the substring, which is like below

    std::string str = (*x)->daytxt;

    std::string str2=str.substr(1,10);

    The Above function is having an issue while doing link-editing the Object module. am getting below errors,

    IEW2456E 9207 SYMBOL _Xran__Q2_3std12_String_baseCFv UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL         LIBRARY.                                                              

    IEW2456E 9207 SYMBOL _Xlen__Q2_3std12_String_baseCFv UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL         LIBRARY.        

     

    Please suggest me if there is any way to fix this issue in Z/OS compilation. If there is any SYSLIB or DLL that has to be added for using this function.

    Thank you.

    Jeeva_S35


  • 2.  Re: Z/os C++ compilation Std::String function error

    Posted Thu November 23, 2017 07:42 AM

    How are you compiling the source which contains these function references? Please post the command line if you are invoking the compiler from USS.

    dinoxlc


  • 3.  Re: Z/os C++ compilation Std::String function error

    Posted Thu November 23, 2017 08:31 AM

    My compilation is using the Mainframe JCL using Compiler SYS1.SCCNCMP(CCNDRVR), we do not use Unix much.  Once Object module is created, Link edit is done using IEWL, below is a snippet of my link edit step..

     

    Thank you.

    Jeeva_S35


  • 4.  Re: Z/os C++ compilation Std::String function error

    Posted Thu November 23, 2017 08:48 AM

    Your linker invocation is missing the side deck for the C++ Standard Library. Take a look at hlq.SCCNPRC(CBCB) proc that is shipped with the compiler. You can model your link step based on that proc and you will only need to set the proc variable STDLIBSD to the version of the side deck that matches the option you used to compile the source i.e. C128 for XPLINK or C128N for NOXPLINK.

    dinoxlc