Columns


C/C++Sources

Victor R. Volkman

Cross-Platform Resources on the Web

Supporting an application on more than one host? Compiling for a minimalist embedded system? You need all the help the web can supply.


Introduction

As editor of C/C++ Sources, my charter is to seek out the best tools and source code available to you on the Internet. From now on, I'll be focusing on two different themes in each installment. In each case, I will bring you the most relevant pages available in several categories:

Web pages which document a library or tool and include hot links to its C/C++ source code

Detailed documentation concerning an important API or protocol

Web pages which organize, categorize, or rank the best freeware and shareware libraries and tools for use with C/C++

Focus on Cross-Platform Development

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. Although 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 for cross-platform developers are stark and uninviting: develop your own compatibility layers (a vast and endless job) or stake the future of your company on a third-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 approaches.

In this focus segment, I'll give you a few pointers to get you started in evaluating both freeware and commercial compatibility 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?":

http://landru.unx.com/DD/solutions/docs/aug95/aug95.mikes.shtml

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:

http://www.r2m.com/windev/cross-platform.html

(You can read more about wxWindows, V, and YACL in Jamie Guinans article, "Platform-Independent GUI Toolkits," elsewhere in this issue.)

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).

http://VTGinc.com/ebennett/xplat/xplat.html

Cross-Platform Freeware and 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 wxWindows 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 platforms you need XView 3.x or Motif 1.2.x and GNU G++ (or compatible compiler). An active and helpful mailing list helps support wxWindows; send e-mail to wxwin-users-request@aiai.ed.ac.uk to subscribe. First, read the FAQ and other information:

http://www.aiai.ed.ac.uk/~jacs/wxwin.html

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. V supports most standard GUI objects, 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 X Windows 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.

http://www.cs.unm.edu/~wampler/

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. Wines license is similar to BSD Unixs. Wine is similar in goals to SunSofts Wabi product, and to Willows Softwares TWIN XPDK product. Wine is still alpha code, and as such may work to varying degrees of success on your system.

http://www.linpro.no/wine/

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 twofold: to be application-centric and to 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 GUI classes 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.

http://www.cs.sc.edu/~sridhar/yacl.html

Cross-Platform Commercial Software

The mission-critical nature of cross-platform projects often requires access to a highly responsive software support team and implementation on a wide range of platforms. Commercial cross-platform products are the best choice to fill this niche, even though their prices can be steep. Heres a sampling of links to commercial product websites, which will give you an idea of their platform specialities at the very least. No vendor has been intentionally omitted.

http://www.willows.com

http://www.visix.com

http://www.xvt.com

http://www.vedge.com

http://www.bristol.com

http://www.unify.com

http://www.synervision.com/dvtool.htm

http://www.blackwhite.com/products/cpt.html

Focus on Real-Time/Embedded Systems

Embedded systems are everywhere; arguably, they are just as prevalent as desktop systems, though they dont get as much attention and glamour in the press. The consulting firm of Embedded Systems Ltd. (Coventry, UK) suggests that our familiarity with desktop computer systems may lead us to incorrectly assume that the majority of microcomputer chips manufactured end up in desktop systems. 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. Therefore, 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 Motorolas new 68HC12 family of microcontrollers. They describe this assembler as follows:

This is still under development, but the current version could be useful for evaluation purposes, and there doesnt seem to be much free/cheap support out there. Its designed to run under MS-DOS 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 e-mail us a report detailing any bugs that you find and any improvements that you feel would be useful.

http://www.embedded-systems.ltd.uk/software/index.htm

Douglas Beatties "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.

http://www.whidbey.net/~beattidp/comput/x65tools/

Dave Dunfield (Nepean, Ontario, Canada) supports an entire suite of "small" C compiler tools from the MICRO-C development system. This suite 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 it remains highly independent of CPU and OS. Specifically, MICRO-C provides separate support for 68HC08, 6809, 68HC11, 68HC16, 8051/52, 8080/8085, 80x86, and 8096 CPUs. Dunfields suite 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). MICRO-C is available on SIMTEL and mirrors (see "C/C++ Mailbag" later in this column).

ftp://oak.oakland.edu/pub/simtelnet/msdos/c/mc302emb.zip

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:

ftp://oak.oakland.edu/pub/simtelnet/msdos/crossasm/embedpc.zip

SIMTEL contains far more cross-assembly tools than I could possibly list in this column. Suffice it to say that SIMTEL supports each of the following microprocessors with at least one freeware or shareware package:

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

ftp://oak.oakland.edu/pub/simtelnet/msdos/crossasm/00_index.txt

In that same directory, youll find xasm220.zip, a set of 12 cross assemblers for 65xx, 68xx, 80xx CPUs.

A C++ Tutorial

The "C++ Tutorials" page by Glen McCluskey & Associates provides a fresh perspective on the C++ language in a highly organized topic tree. With the help of this page, 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 that had undergone a lot of change since I first learned about it.

http://rmi.net/~glenm/tutor.html

Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to the C/C++ Users Journal since 1987. He is the author of the book Windows Programming with Shareware Tools. He can be reached at the HAL 9000 BBS (313)663-4173, URL http://www.HAL9K.com/home.htm, or email to sysop@hal9k.com.