在z/OS USS中使用C++(CXX)编译链接时SYSLIB定义问题求助
Let's break down how to resolve this IEW linker error—ABEND S013-38 means the linker can't access the SYSLIB partitioned data sets (PDS/PDSE) you've specified, even after setting _CXX_LSYSLIB. Here are actionable steps to diagnose and fix the issue:
Verify the existence and type of your specified data sets
First, confirm each library in your_CXX_LSYSLIBactually exists and is a valid PDS/PDSE. Use thelistdscommand for each entry:listds CEE.SCEELKEDX listds CEE.SCEELKED listds CBC.SCCNOBJ listds SYS1.CSSLIBCheck the output for "Data Set Type"—it should show "PARTITIONED" or "PARTITIONED DATA SET EXTENDED". If any dataset is missing, correct the name or confirm with your system admin if it's required for your build.
Check your read permissions on the datasets
Even if the datasets exist, your user ID might lack read access. Usels -Eto inspect permissions:ls -E CEE.SCEELKEDXLook for the
r(read) flag in the permission string for your user or group. If you don't have read access, reach out to your system administrator to grant the necessary permissions.Validate your
_CXX_LSYSLIBenvironment variable format
Double-check the variable for typos, incorrect case, or invalid separators:- z/OS dataset names are case-sensitive (they should be all uppercase) — ensure you haven't used lowercase letters.
- The path separator is indeed
:, but make sure there are no extra spaces before or after the colons. - Print the variable to confirm its value matches your intended setup:
echo $_CXX_LSYSLIB
Test linking manually to bypass environment variables
To rule out issues with the_CXX_LSYSLIBvariable not being picked up, try invoking the linker directly with the SYSLIB datasets specified explicitly:# First compile your source to object code cxx -c your_program.c # Then link manually with IEWL iewl your_program.o 'SYSLIB(CEE.SCEELKEDX,CEE.SCEELKED,CBC.SCCNOBJ,SYS1.CSSLIB)' -o your_programIf this succeeds, the problem is likely with how the environment variable is being applied (e.g., it's being overridden by another variable, or not exported correctly in your shell session).
Check for conflicting environment variables
Other CXX-related variables might be overriding_CXX_LSYSLIB. List all CXX-related environment variables to spot conflicts:env | grep CXXLook for variables like
_CXX_LFLAGSthat might include their own SYSLIB specifications, which could take precedence.Ensure library and compilation target bitness match
Libraries likeCEE.SCEELKEDXare 64-bit, whileCEE.SCEELKEDis 32-bit. Confirm your compilation flags align with the library bitness:- For 64-bit builds, use
-Wc,LP64 - For 32-bit builds, use
-Wc,ILP32
Mismatched bitness can lead to unexpected access errors, so make sure your compile options match the libraries you're linking against.
- For 64-bit builds, use
内容的提问来源于stack exchange,提问作者Papa Dilbert

