Article View: comp.os.os2.misc
Article #17704Re: Need help on GNU/GCC compiler for OS/2
From: Chris Waters
Date: Fri, 05 Mar 1993 21:15
Date: Fri, 05 Mar 1993 21:15
55 lines
3435 bytes
3435 bytes
This is really an OS/2 programming issue. Followups have been redirected to comp.os.os2.programmer. Apologies to the c.o.os2.misc and gnu.gcc.help people who have to suffer through one more post on the topic. In <1993Mar4.221055.5945@njitgw.njit.edu> dic5340@hertz.njit.edu (David Charlap) writes: >In article <1993Mar4.044754.17560@math.ucla.edu> nzhong@oak.math.ucla.edu (Ning Zhong) writes: >> I downloaded the GCC v.2.2.2 from ftp-os2.nmsu.edu (directory /pub/os2/2.0/ >>programming/gcc2-2.2.2) and installed in my D: drive like this: I *highly* recommend checking out the EMX compiler. It's a port of gcc 2.3.3, and it has *far* more functionality! [problem description elided] >>I did try "gcc -c sample1.c" and then "link386 sample1.obj" though, and it >>worked. I just want to know whether this can be done in a single command, >>and using the GCC linker, if there is one. And a final question, what "-l" >>option should I use to compile a C++ program? It can be done in a single command with EMX. gcc -c sample1.c -o sample.exe Will build the executable. You can also generate an .o file to link with the included ld, or you can generate an .obj to link with LINK386. EMX also comes with DLLs to provide many standard UNIX system calls (including fork()!). And it supports all the PM & VIO/KBD/MOU calls. Also, it has a standard library DLL, which you can link with to get much smaller executables in most cases. >C++ code will require a collect step. Use collect.exe to do this. I >don't know exactly how, though. I have not written any C++ code with >GCC. To the best of my knowledge, the EMX version of gcc does not require collect. I also haven't written any c++ code with EMX, but I think that the following would work: gcc -c samplepp.cc -o samplepp.exe You might have to add -lgpp, I really don't know about that. In any case, EMX is more up-to-date, more powerful, more flexible, easier to use, has more options, can be used to create 32-bit DOS applications as well as OS/2 applications (it has a DOS extender included), and is an all-around better system in my book. It's unfortunate that the people who did the OS/2 gcc 2.2.2 decided to name their system gcc, IMO, as people looking for a good C compiler may well grab this, and never realize that EMX exists and is a better gcc to boot. :-( -- Chris Waters | the insane don't | "Without gratuitous sex, we would be no xtifr@netcom.COM| need disclaimers | better than animals." --M. Swanwick
Technical Details
Message-ID:
<1993Mar5.211513.14280@netcom.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!gatech!howland.reston.ans.net!spool.mu.edu!olivea!decwrl!netcomsv!netcom.com!xtifrReferences:
<1993Mar4.044754.17560@math.ucla.edu> <1993Mar4.221055.5945@njitgw.njit.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1044c2,32d7bf4e17ba2c91 X-Google-Attributes: gid1044c2,public X-Google-Thread: 11318c,32d7bf4e17ba2c91 X-Google-Attributes: gid11318c,public X-Google-Thread: 10121b,32d7bf4e17ba2c91 X-Google-Attributes: gid10121b,public X-Google-ArrivalTime: 1993-03-06 00:15:09 PST Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!howland.reston.ans.net!spool.mu.edu!olivea!decwrl!netcomsv!netcom.com!xtifr From: xtifr@netcom.com (Chris Waters) Newsgroups: comp.os.os2.misc,comp.os.os2.programmer,gnu.gcc.help Subject: Re: Need help on GNU/GCC compiler for OS/2 Message-ID: <1993Mar5.211513.14280@netcom.com> Date: 5 Mar 93 21:15:13 GMT References: <1993Mar4.044754.17560@math.ucla.edu> <1993Mar4.221055.5945@njitgw.njit.edu> Followup-To: comp.os.os2.programmer Organization: Netcom - Online Communication Services (408 241-9760 guest) Lines: 55