Using JCL so SYSDEFSD is also an output from the linker as well  I did look at 
the PDF It had of an example  what I am trying to do HLASM -> C DLL using 
CEEPCALL macro for the exported functions however I think I need to do a 
CEEFETCH for the DLL instead of the DLLLOAD()   
I am also assuming that CSECT from where I call the C DLL has to have a 
CEEENTRY 
I am also assuming that the C DLL need a main() I don’t know if there is 
anything special I had to do there or when/if it gets invoked as I am just 
going to call the exported functions
I am processing a VB file or to be more specific SYSADATA (I am going to 
display the program listing in Richedit editcontrol)

And using fopen/fread to do the I/O

thanks
        


-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Tony Harminc
Sent: Thursday, July 4, 2019 5:42 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: XL C\C++ DLL last few questions before I try it

On Thu, 4 Jul 2019 at 15:29, Joseph Reichman <reichman...@gmail.com> wrote:

> Last question I got a clean compile, prelink, link from a C program I 
> tried to compile in samplib, however I looking  at the prelink output 
> It gave me unresolved extern for C runtime library sprint etc

Why are you using the prelinker? Just use the Binder. I don't believe there is 
anything the prelinker can do that the Binder can't. And it certainly 
complicates the process. I also don't know if the prelinker supports DLLs...

Regardless, how are you running your compile? JCL or xlc or...?

> Does that library go to the syslib, prelink or linker and would 
> probably bee some CEE.. library

Probably you need SYSLIB pointing at (at least) CEE.SCEECPP, CEE.SCEELKEX. 
That's for JCL; you can also use the SEARCH/LSEARCH compiler options to point 
to them.

> While Visual Studio when creating C DLL project generated a DLLMain 
> and PROCESS_DETCH/ATTACH THREAD_DETACH/ATTACH I don't need any of that 
> with z/os

Did you look at the "big picture" presentation that Jon Perryman posted a 
couple of days ago?
ftp://ftp.software.ibm.com/s390/zos/le/an8130.pdf  It's dated, but still a 
useful overview of the process.

> Says I should use the CEEPCALL macro

Yup.

> Just wondering if I have t have a CEEENTRY macro for the CSECT from 
> which I would like to call the exported functions from

Yup.

> Any special debugging advice I guess the compiler CCNDRVR generates 
> the assembler code I could always debug it with TEST

TEST doesn't understand a whole bunch of things about the DLL and LE 
environments. But it may work for the basic stuff.

Might be time to look at debugging with dbx...

Tony H.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to