Baby X on MS Windows

M

Malcolm McLean

I've ported Baby X, the simple C language toolkit, to Microsoft windows

Now you can compile a Baby X program for Linux or Windows. There's still atleast one glitch to get out - Windows defines an entry as WinMain. I'm notsure what the best way is to allow Baby X programs to compile without the trivial source code change needed.

I hope to move to version 1 fairly soon.

It's on Sourceforge

https://sourceforge.net/projects/babyx/
 
J

jacob navia

Le 05/04/2014 19:04, Malcolm McLean a écrit :
I've ported Baby X, the simple C language toolkit, to Microsoft windows

Now you can compile a Baby X program for Linux or Windows.

There's still at least one glitch to get out - Windows defines an entry
as WinMain.

I'm not sure what the best way is to allow Baby X programs to compile
without the trivial source code change needed.
I hope to move to version 1 fairly soon.

It's on Sourceforge

https://sourceforge.net/projects/babyx/
lcc-win has "main" as its entry point for ALL programs.

If a rogram defines WinMain as its entry point and has no "main"
function, lcc-win provides a default "main" function that just calls
WinMai with the right parameters.

So, the flow is like this:

1) System loads the program and calls its entry point (defined in the
executable headers)

2) The entry point calls the C initialization function

3) The initialization function calls main()

4) If the program doesn't have a "main" function the linker uses the
default main function in the C library that calls WinMain.

In your case, since you haven't a compiler, the best thing is to IGNORE
WinMain and just use main().

Note: A GUI program can use "main()" as its entry point WITHOUT ANY
PROBLEMS. The fact that a program is GUI or console is defined by the
linker when it sets a flag in the executable itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top