Re: C runtime library for Win32



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.

.



Relevant Pages

  • Re: From Console to WIn32 App
    ... You can make Windows GUI programs with any compiler/IDE. ... optionally other vendor proprietary libraries (like MFC, ... You need Win32 programming tutorial. ... Windows programs using Win32 API directly. ...
    (microsoft.public.vc.language)
  • Re: Games made with BBC BASIC for Windows
    ... Windows (i.e. Win32) has just one standardised GUI; ... and dozens of other class libraries that build on these. ...
    (comp.sys.acorn.misc)
  • How do I get GLUT to work with GCC for Win32?
    ... I've go GCC working for Windows? ... These same command can be used in Windows with modification. ... GLUT is an OpenGL Utility ... How do I compile using GLUT for GCC for Win32? ...
    (comp.lang.cpp)
  • Re: Can MS listen to customers?
    ... IE is comprised of a set of libraries that other applications use. ... a HUGE portion of even a minimal install of Windows (or even in ... For Windows, Notepad, Paint, IE, OE, msconfig, Wordpad, Hearts, NT ...
    (microsoft.public.windowsxp.general)
  • Re: problem of building stardict
    ... checking for gcc... ... checking for C compiler default output file name... ... checking how to recognize dependent libraries... ... checking for gfortran... ...
    (Fedora)