How do you build a DLL with gcc? 2003 R3 SUA (Full Version)

All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum



Message


rjnorman -> How do you build a DLL with gcc? 2003 R3 SUA (Feb. 23, '06, 4:07:56 PM)

I want to have a mainline module (this could be either Win32 or SUA) which loads a dll containing C functions that use the POSIX (aka SUA) API, but expose functions for later use. Then I want to load a Win32 DLL which will have calls to the functions in the POSIX (SUA) dll.
The small 'Help_and_ReleaseNotes" document talks about using link.exe to creat a .def file, but link.exe has no such function that I coud find. Also, even if I manually create a .def file, then what do a I do with it? gcc & ld do not seem to know anything about .def. I also tried using link.exe but then it has problems finding the POSIX function even when I also included libc.a for link.exe. I did not try libc.so with link.exe but I do not think link.exe would know what a .so is...

Can anyone give me more details specific examples for creating a dll using gcc (or cc or c89) and using a .def to define the entry points to the dll?

Thanks
Ron Norman




Rodney -> RE: How do you build a DLL with gcc? 2003 R3 SUA (Feb. 26, '06, 12:10:59 PM)

I suggest that you look at the internals of the c89 script.
The "-R" option is what sets the mixed-mode compile and link.

There is not a "POSIX DLL" in the sense you are thinking of it.
The PSXDLL.DLL is a thin layer for the LPC calls from a process
to the Interix subsystem. All of the shared libraries with Interix/SUA
are Unix shared libraries -- not DLL's.

The general intent of the mixed mode is for a Unix/Interix program to
be making calls to the Win32 API's. Not the other way around. The resulting
binary is marked as Win32, but the whole thing can be fragile because you
are mixing the paradigms of two different OS's (Unix & Win32).




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.063