People are talking about Genitor...
Visit Genitor Corporation Online Now!

C/C++ Sources

By Victor R. Volkman
January 1997 (No. 7)


Ask any developer who has delivered the same application on two significantly different platforms (e.g. Windows NT and Unix) and they will tell you that maintaining a common set (or at least subset) of source code is crucial to both maintenance and development. Though C and C++ are built around solidly defined and portable runtime libraries, these libraries fall short of meeting real-world interface requirements such as GUI, windowing, bitmaps, and client/server communication. The choices are stark and uninviting: develop your own compatability layers (a vast and endless job) or stake the future of your company on a 3rd party library vendor. In several years of cross-platform development experience on MS-DOS, Windows, Unix, and IBM mainframes I've seen the best and worst of both ways. In this focus segment, I'll give you a few pointers to get you started in evaluating both freeware and commercial compatability libraries and tools. For those of you who have yet to embark on a cross-platform project, I recommend Steven Mikes' whitepaper entitled "Are you REALLY Ready for Cross-Platform Development?"

The R2M Software company maintains the "Cross Platform Development Internet Resources" pointers page, which is a small subset of their mammoth "Internet Resources for Windows Developers Index". The cross-platform page bridges both freeware and commercial libraries, including several that I'll be mentioning later in this column: wxWindows, V, WINE, YACL, and more:

Eric Bennett has created "The Cross-Platform Page: Index" which is an invaluable resource for locating multimedia players on all platforms. Bennett includes links to audio, graphics, video/movie, and compression tools. Need an MPEG player for Unix? A .MOD audio player for your Apple IIgs? A "tar" extractor for your Macintosh? This page includes links to download many of these programs (some of which have source availability, all of which are freeware or shareware).


Julian Smart runs the "wxWindows Home Page", which organizes the documentation and FTP links for this platform-independent C++ GUI library. The wxWindows library has no restrictions on its use in commercial products. Applications built with vxWindows can run on Motif, Open Look, Windows 3.1, and Windows NT. On the PC it supports Microsoft VC++, Borland C++ 3.1/4.0, and Symantec C++. On UNIX platform you need, XView 3.x or Motif 1.2.x and GNU G++ (or compatible compiler). An active and helpful mailing list helps support vxWindows send email to to subscribe. First, read the FAQ and other information:

Dr. Bruce E. Wampler has created "V", a portable C++ GUI Framework intended to support a wide variety of applications on different graphical interface platforms. Applications developed using V will have the look and feel of the native platform, yet will be portable across platforms. Most standard GUI objects are supported by V, including windows with menus, status bars, tool bars, and a drawing canvas; modal and modeless dialogs with the most common controls, and portable printing support. Basic support is available now for XWindows and versions for Windows 95 and NT should be available by the time you read this. An OpenGL add-on is currently in beta testing."

Dag Asheim maintains the "WINE Project" page, a resource linking documentation and code for this freeware MS Windows API emulation library. Wine is an emulator that allows MS Windows applications to run on Intel-based Unix systems (currently NetBSD, FreeBSD, SCO OpenServer, Unixware, and Linux) running X11. As a library it will allow the use of the Windows API for Unix/X11. License is similar to BSD Unix. Wine is similar in goals to SunSoft's Wabi product, and to Willows Software's TWIN XPDK product. Wine is still alpha code, and as such may or may not work to varying degrees on your system.

M.A. Sridhar publishes the "Yet Another Class Library (YACL)" resource page supporting this cross-platform library. YACL is a C++ class library that offers high-level abstractions for common programming problems. Its design goal is to be both application-centric and take advantage of C++ facilities (e.g. operator overloading and templates) wherever possible. YACL implements both scalar (String, Integer, Date, etc.) and container (sequence, set, tree, etc.) core classes. All of these classes support passivation (i.e. stream-friendly I/O methods). The GUIclasses are based on a variation of the model view controller (MVC) paradigm. The YACL application framework supports the widest variety of compilers and OSes I've ever seen in a freeware library, including Windows 3.1, Windows NT, OS/2 2.x and 3.0, SGI, SUN, Ultrix, Linux, RS/6000, and HP-UX.

YACL is coming soon to C/C++ Users Group CD-ROM


The mission-critical nature of cross-platform projects often demands the comfort of having a highly responsive software support team and a wider range of platforms. This niche is best filled by comercial cross-platform products, though prices can be steep. Here's a sampling of links to commericial product websites, which will give you an idea of their platform specialities at the very least. No vendor has been intentionally omitted.


What are embedded systems? The consulting firm of Embedded Systems Ltd. (Coventry, UK) points out that everyone is so familiar with desktop computer systems that they may incorrectly assume that most microcomputers go into them. Most microcomputers are actually used within embedded systems; that is systems that perform some other function. Examples include computers within automobiles, microwave ovens, VCRs, elevators, answering machines, and much more.

The nature of embedded systems development is such that development and debugging facilities on the target system may be minimal or non-existent. As such, cross-assemblers, cross-compilers, and emulators are the tools of the trade for the embedded systems developer.

Embedded Systems Ltd. provides a freeware assembler for Motorola's new 68HC12 family of microcontrollers. Their description is as follows:

"This is still under development, but the current version could be useful for evaluation purposes, and there doesn't seem to be much free/cheap support out there. It's designed to run under MSDOS but could be ported to Windows 3.x if there's enough interest. Download it and try it out. All we ask is that you email us a report detailing any bugs that you find and any improvements that you feel would be useful."

Douglas Beattie's "MA65" 6502 cross-assemblers produce native 6052 code and are available for both MS-DOS and CP/M-Z80 environments. This is a full-featured macro assembler featuring macro nesting up to 25 levels, long labels, conditional assembly, and C-style arithmetic operators. MA65 can generate object code in Motorola S-records, binary image, or Intel HEX records. Available reports include symbol table, cross-reference, cycle count, and classic op-code listing.

Dave Dunfield (Nepean, Ontario, Canada) supports an entire suite of "small" C compiler tools from the MICRO-C development system. This includes the MICRO-C C compiler itself for MS-DOS, many sample C programs, and a demonstration version of MICRO-C for embedded systems. MICRO-C is a tiny compiler which can run with less than 32k RAM and yet is highly independent of CPU and OS. Specifically, platform support is available separately for 68HC08, 6809, 68HC11, 68HC16, 8051/52, 8080/8085, 80x86 and 8096 CPUs. It also includes a fully functional MICRO-C compiler executable built for the MS-DOS 80x86 environment. This version generates code in .ASM format so Microsoft MASM, Borland TASM, or equivalent are required (not included). Available on SIMTEL and mirrors (see "C/C++ Mailbag" later in this column).

MICRO-C is available now on C/C++ Users Group CD-ROM

Dunfield also provides some free utilities which may be of interest to embedded systems developers. His "Functions for DOS-less Embedded PC applications" archive is designed to help you write code for PC hardware that runs without an operating system. Some of the subsystems included are:

SIMTEL contains many more cross-assembly tools that I could possibly list in this entire column. Suffice it to say that each of the following microprocessors has at least one freeware or shareware software package supporting it:

Check the index for the latest list of what's available:

In that same directory, you'll find, a set of 12 cross assemblers for 65xx, 68xx, 80xx CPUs.


In the preface to The Unix Programming Environment (1984), Kernighan and Pike provide a brief history of Unix and C. They recount that Ritchie and Thompson rewrote the existing Unix kernel with C in 1973, breaking the tradition that all major OSs were written in Assembler. Kernighan and Pike attribute the success of Unix at the time as follows:
"We can discern several reasons. First, because it is written in C, it is portable -- Unix systems run on a range of computers from microprocessors to the largest mainframes. Second, the source code is available and written in a high-level language... Finally, and most important, it is a *good* operating system, especially for programmers"

Now, 12 years since their analysis, these reasons still hold true -- and perhaps even more true today. Thanks to the efforts of the developers of GNU, Linux, and FreeBSD, the source code for Unix-derived operating systems is in fact freely available and not just limited to a mere handful of licensees.


The GNU project has been the primary goal of the Free Software Foundation (FSF) since its founding in 1984. GNU, a recursive acronymn which stands for "GNU's Not Unix", focuses primarily on providing enhanced versions of Unix-compatible programs and libraries. All GNU programs include complete C/C++ source and a special license for redistribution of it. The hallmark of GNU software is its portability, with most packages supporting ten or more different CPUs or OSs. The cornerstone of the GNU project is the GNU C/C++ compiler and library (better known as g++ and libg++). The entire list of GNU freeware would fill several installments of this column. I'll simply list 10 of the most interesting (to me) packages and the pointers to get you started:


Linux is a freely-distributable implementation of UNIX for Intel, Motorola 68k, DEC Alpha and Motorola PowerPC machines. It supports a wide range of software, including X Windows, Emacs, TCP/IP networking (including Ethernet and PPP), and much more. Linux was originally written by Linus Torvalds (Helsinki, Finland). In the three years since, Linux has become one of the most popular free Unix systems available, and is continually being developed by Linus and teams of people all around the world. Ports for many other CPUs are in progress, including SUN Sparc and MIPS chips.

The Linux kernel is covered by the GNU Public License (GPL), and is usually bundled with various binaries that comprise a working unix operating system. One of the most confusing things about Linux for the novice, is choosing which among the various pre-bundled "distributions" available to install. In order to make Linux a practical system to use, it is always distributed with many GNU utilities (see previous section). Here's the best place to start:


FreeBSD is an advanced BSD UNIX operating system for PCs with excellent support for TCP/IP networking, advanced technical features, and ability to run a wide variety of applications. It also offers easy installation and of course full source code availability. FreeBSD can run on Intel compatible CPUs with just 4MB RAM and 60MB disk space available. TCP/IP support includes Network File Systems (NFS), Network Information Service (NIS), DNS, and BIND, remote login (rlogin), FTP server, packet routing including PPP/SLIP, and IP Multicast. Some of the heaviest trafficked sites on the Internet are built using FreeBSD and the GNU Apache web server. FreeBSD compatibility modules allow you to run programs designed for Linux, SCO Unix, NetBSD, and BSDI Unix.


The "C++ Tutorials" page by Glen McCluskey & Associates provides a fresh perspective on C++ language in a highly organized topic tree. Beginning C++ programmers can ease into the language through "C++ as a Better C". Developers with more experience will appreciate clarifications of ANSI/ISO changes. For example, the essay on "Extern Inline Functions" brought me up to date on an area which had undergone a lot of change since I first learned about it.


If you would like to share some of your favorite C/C++ sources, please email me at Here's a sampling of queries which have come to me recently via email. writes:
"In Sep 96 CUJ page 92 you listed a location to obtain a C Utility "C Function Tree" and "C Structure Tree". The programs were not at the location printed in your mag..."

I know it is difficult to keep up with items like that, but if there is a missprint somwhere I would appreciate getting the correct location or file name. I am in need of a utility like the one described.

I am a subscriber to CUJ. Do you keep your volumes on line somewhere??"
C/C++ Answer Man:
C Exploration Tools for Windows author Juergen Mueller sent me a message a week before yours with new filenames and directories. Its a daunting task for a printed medium to keep pace with the ever-changing Internet landscape. Hope you have better luck with these: The "C/C++ Users Journal" has a small amount of content available online at

C Exploration Toosl for Windows available now on C/C++ Users Group CD-ROM writes:
"I enjoyed reading your material in CUJ. Could you help with locating some sources on graphs? What I am interested in is code for directed and undirected graphs - ie nodes and arcs in C/C++."
C/C++ Answer Man:
As I've mentioned in a previous column, I recommend "LEDA: The Library of Efficient Data Types and Algorithms" ( maintained by Christian Uhrig ( at the Max Planck Institute of Computer Science. LEDA is a platform-independent C++ class library that supports most compilers including Zortech, Borland, and AT&T style "cfront" C++ compilers. Specifically, LEDA supplies efficient implementations for many data types such as Fibonacci heaps for priority queues, red-black trees, dynamic perfect hashing for dictionaries and more. LEDA contains an especially useful graph implementation including: You can obtain LEDA by FTP from, note that it is available BOTH in pkZIP and tgz (tar'red and gnuZipped) archive formats:
     Filenames                  Size
     -----------               --------
     FAQ                          19 Kb    FAQ text
     LEDA-R-3.4.tgz             1275 Kb    Tar'ed and GZip'ed               1699 Kb    Zip Compressed Data             955 Kb    Postscript Document writes:
"In the past you have listed only a few SIMTEL mirror site addresses. May I suggest publishing a more complete list and telling people to look there for their closest mirror? The file includes the latest list of all the official SimTel mirrors."
C/C++ Answer Man:
Thanks for the tip, this will allow us to both save valuable space and help people find a more appropriate mirror server rather than tying up the limited resources of SIMTEL.

<H2>Up</H2> <H2>Prev Doc</H2> <H2>Next Doc</H2>
This page maintained by Victor R. Volkman
Last updated on 10/25/98