TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Duane Bielling
from: Rob Landley
date: 1995-04-12 22:18:26
subject: DOCS for EMX/GNU C++

>  DB>  I've d/l'd what I think is all the EMX/GNU (2.5.4) stuff
>  DB> for C/C++ but  haven't figured out how to compile and link
>  DB> C++ code.  The C code is no prob.  and I use that regularly,
>  DB> but don't know what I'm doing when it comes to  fiddling
>  DB> with C++ in OS/2.

Most of the really interesting doc stuff is in the emx/doc directory in the
files emxdev.doc and libref.doc.  The first is all the command line options
to the compiler and the various ways you can compile.  Basically:

Method 1) Compile a unix a.out file and stick a band-aid on it so it can
run under both dos and OS/2.  This is big.  This is slow.
Method 2) Compile a standard .exe that calls the emx.dll to do half its'
stuff.  The advantage is that this is small.  The disadvantage is that you
need emx.dll to run it.
Method 3 (my favorite):  Compile a standard .exe that does -NOT- need
emx.dll.  This is basically what all the other compilers out there do.

For method 3, you need the command line arguments -Zomf and -Zsys.

For example:

gcc -Zomf -Zsys -o filename.exe file1.cpp file2.cpp file3.cpp file4.cpp

Will compile the four *.cpp files and link them into a file called
"filename.exe"  (The -o tells it to link into the output file
which is the next argument.  Without that it takes the first filename in
the list (minus extension) as the name of the .exe file.)

If you have .def or .res files, just throw them in there with the *.cpp
files and it should recognize them.

If you want to figure out how the "make" command works, 1) you
have to download a copy of one, it doesn't come with it, 2) you're on your
own.  I don't understand make either.  I'm considering writing a #%&^{at}^
IDE for gcc just because it needs one so badly, but I haven't got time...

Rob
 
--- 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™.