Howdy folks.  I've been trying to get my feet wet with a small port from
unix C to AS400.  I've dug into the compiler reference, the unix to as400
porting redbook, and the porting with PASE redbook, but I'm still running
into some pretty basic workflow problems.

I uploaded my source files via ftp to a subdirectory of /QOpensys, so
they're stream files.  After editing the files to make sure none of their
lines exceeded 80 chars, I used CPYFRMSTMF to copy one of them to the
source member of a native library.  The source code in the native library
member #includes a header file that currently only exists as a STMF, in
another IFS directory outside of /QOpensys.

In QShell (green-screen qsh), I can invoke ixlc on the main C file under
/QOpensys, and it spits out a bunch of compile errors related to the
header file it wants to include.  No surprise.  When I specify the other
include directory using ixlc sourcefile.c -I/blah/version/include, I no
longer get the compile errors, but I get a message saying the program was
not created because the compile failed, and no additional information.

Back in the native environment, I can submit a job calling CRTBNDC on the
native library copy of the main source file, but I've been totally unable
to get CRTBNDC to find the STMF format header files.  I tried specifying
the path to the header inside the main source file, and specifying the
include directory via the INCDIR('/blah/version/include') parameter to
CRTBNDC, and get identical job output.  According to the compiler
reference, I can call CRTBNDC or CRTCMOD on a STMF file, but if I do so
the INCDIR parameter will be ignored.

Clearly I'm missing something crucial.  Do I have to allocate a file
to hold the program output from ixlc, and explicitly tell the compiler
where to go looking for it?  On the CRTBNDC side, is it even possible to
point to STMF headers in source code compiled from native library members?

Looking forward to larger ports, how can I copy from stream files without
truncating the lines?

Any help is of course much appreciated-


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].