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).
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.
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).
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 xasm220.zip, a set of 12 cross assemblers for 65xx, 68xx, 80xx CPUs.
"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 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:
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.
"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: http://www.simtel.net/pub/simtelnet/win3/prog/cxtw109.zip ftp://ftp.simtel.net/pub/simtelnet/win3/prog/cxtw109.zip ftp://garbo.uwasa.fi/windows/programming/cxtw109.zip The "C/C++ Users Journal" has a small amount of content available online at http://www.cuj.com.
"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" (ftp://mpi-sb.mpg.de/pub/LEDA/leda.html) maintained by Christian Uhrig (email@example.com) 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:firstname.lastname@example.org writes:
You can obtain LEDA by FTP from ftp.mpi-sb.mpg.de:/pub/LEDA, note that it is available BOTH in pkZIP and tgz (tar'red and gnuZipped) archive formats:
- Iterations such as "for all nodes do" and "for all neighbors do"
- Add and delete vertices and edges
- Arrays and matrices indexed by nodes and edges
- Methods which mimic textbook pseudo-code directivesFilenames Size ----------- -------- FAQ 19 Kb FAQ text LEDA-R-3.4.tgz 1275 Kb Tar'ed and GZip'ed LEDA-R34.zip 1699 Kb Zip Compressed Data MANUAL-R-3.4.ps 955 Kb Postscript Documentftp://ftp.mpi-sb.mpg.de/pub/LEDA/www/leda.html
"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 ftp://ftp.coast.net/SimTel/msdos/filedocs/download.inf 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.