Re: C runtime library for Win32
- From: "santosh" <santosh.k83@xxxxxxxxx>
- Date: 15 Nov 2006 09:45:51 -0800
Paul Edwards wrote:
I have written a public domain (not GPL etc) C runtime library
(PDPCLIB) for DOS, OS/2 and MVS. You can see it here:
http://sourceforge.net/projects/pdos/
I now wish to port it to Win32, so that I can create executables
to run under Windows 98 command prompt where every byte
of the executable is from public domain code.
Consider a fresh rewrite instead of a port.
<snip>
Secondly, I'd like to know what process I need to use to start
writing applications that call these Win32 APIs without linking
in GNU libraries. If I just use gcc normally it will automatically
link in GNU libraries. I can use "gcc -nostdinc" to force gcc to
only pick headers up from my specified directories. How do I
force gcc to not link with the normal libraries? Do I need to
use "gcc -c" and "ld" myself? What is the syntax, so that I create
normal 32-bit Windows command line executables?
You'll probably need more options than -nostdinc. Fully reading the gcc
and ld manuals in the best way int the long run.
Also, how do I write to stdout via the Win32 API?
Use WriteFile(). Again the best strategy is to download and install the
Platform SDK supplied by MS.
I needed to write an assembler program in OS/2 as the executable
entry point. Do I need that for Win32 as well?
Yes, the standard library's startup code will have to have some
assembly but it needs only be minimul and 32 bit x86 assembly is very
similar to 16 bit flat model.
I've never done Windows programming before, so sorry for the
newbie questions. I'm really not sure how to get started.
Why don't you try a few small practise apps before graduating to
porting/rewriting the C library?
Anyway, Windows related questions will be best answered on more
specific groups like comp.os.ms-windows.programmer etc. Also take a
peek at the sources for MinGW's runtime library or lcc-win32's standard
library to get a feel for what you must do. Fully 90% of the changes
would be the system calls. Unfortunately the Windows API is far from
simple and you'll have to spend *considerable* time on MSDN and with
Platform SDK before getting it right.
.
- Follow-Ups:
- Re: C runtime library for Win32
- From: Paul Edwards
- Re: C runtime library for Win32
- From: Richard Heathfield
- Re: C runtime library for Win32
- References:
- C runtime library for Win32
- From: Paul Edwards
- C runtime library for Win32
- Prev by Date: Re: Need to Allocate more space than size_t
- Next by Date: Re: C runtime library for Win32
- Previous by thread: Re: C runtime library for Win32
- Next by thread: Re: C runtime library for Win32
- Index(es):
Relevant Pages
|