TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Andrew Grillet
from: Rob Landley
date: 1995-05-02 15:34:10
subject: Re: Borland and EMX ...

> Since the whole of OS/2 is written in C, presumably it is  linked with the
> C RTL. Can I share the system copy of C RTL, and if so, how? Is EMX
> different from Watcom/CSet, or do the same rules apply with all?

I wonder when I became an expert on EMX?  This is the third question today...

OS/2 has a set of .DLL files, but at this point you're not likely to be
using them yourself (except perhaps for some PM stuff, I don't know...)

You -CAN- link your program to use a "C runtime library" .dll
file, under EMX it's the -Zcrtdll option.  This is seperate from the
emx.dll file, which is for unix system call emulation purposes.

You see...  EMX is a port of a unix package.  By default it creates unix
style a.out executable files.  OS/2 can run these by 1) sticking a short
little .exe file header onto the beginning of the file (the program
emxbind.exe does this), and 2) using emx.dll to handle the unix system
calls that a.out file is making.

This is slow.  This eats ram.  But it offers the highest level of
compatability with unix.  If you're porting unix stuff to OS/2, that's the
easy way.


If you're using EMX as a straight OS/2 compiler, there's no need to deal
with this unix emulation nonsense.  In that case, you feed it the command
line options

-Zomf (create .obj files instead of .o files, and link with .lib files
instead of .a files.  PC format instead of Unix format.)

-Zsys (link with the system library instead of the unix emulation library.)

emx -o filename.exe -Zomf -Zsys file1.cpp file2.cpp...

Will create an .exe file named "filename.exe", which can run
without any run time .dll files.

emx file1.cpp file2.cpp...

will create a file named "file1.exe" that will need to access
emx.dll when you run it.  This way some more unix type functions are
available (like fork()), but it's not the way I'd recommend for OS/2
specific projects.  It's a unix emulation library.

Read the docs.  They mention all this crud.

Rob

(P.S.  You'll want to look up some optimization stuff like "stripping
the symbol table", which is some debugging info put into the .exe that
you don't need.  I think the option is -s, but don't quote me on that... 
Read the docs.)
 
--- Xblat
* Origin: The Conversation Pit, Marlton NJ 609-985-7553 OS/2 V34 (1:266/30)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 266/30 40 100 505 3615/50 396/1 270/101 105/103 42 712/515 711/808 809
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.