Led Class Library 3.0 / Building with Led

Overview

Led is a C++ based class library. It is distributed in the form of a bunch of C++ headers and sources, which you include with your own projects. Led comes with several sample programs and components. Knowing how to build these should tell you all you need to know to build your own applications with Led. But just in case, a short tutorial on building your own applications with Led is provided.

For the most part, with modern IDEs, there is little which isn't obvious about how to build with Led. Led is distributed with project files to build the various applets and components using the most recently released version of the Microsoft Developer Studio Visual C++ (MSVC), and Metrowerks CodeWarrior Pro (MWERKS). Some build files (makefiles) and project files are provided for users of Borland C++ Builder and Gnu CC (GCC).

The Led headers retain support for building with the preceding release for each of these compilers/development environments. But only the current release is actively supported by Sophist Solutions. If you need to build with an outdated version of one of these IDEs, you shouldn't have too much trouble. But expect some.

Building with supported tools

Building LedIt!, or LedLineIt! with MSVC 6.0:

Sample workspace files (.dsw) are provided with each applet/component. As is typical for MSVC, each applet or component has DEBUG and RELEASE targets. And each workspace has separate projects for the included Led library, and the application/component-specific code.

The only non-obvious thing about building these applications in MSVC60, is that you must install the Led sources and sample applications at the top level of some drive letter, in order for the hardwired paths in the project file to work out, and find the right sources.

To build, simply open the workspace (.dsw) in MSVC60, select the target of interest, and hit the build button.

Building LedIt! or LedLineIt! with Metrowerks Code Warrior Pro5 on the Mac:

Sample project files (.mcp) are provided with each applet. Each applet has DEBUG, RELEASE, and NODEBUG (same as RELEASE, but with macsbug symbols) targets. Also, a 68K target is provided.

To build, simply open the project file for the applet of interest, and select the target you want, and select "Make" from the menu.

Building with UNsupported tools

Though Metrowerks CodeWarrior Pro5 is now available hosted on Windows, this is still not supported in Led. It probably wouldn't be too hard, but it was the Led development team's judgment that these tools were still too immature to be worth much effort/testing. These will probably be supported at some point in the future, if there is customer demand.

If you are building with an old version of MSVC, you may want to acquire an old release of Led, and adopt the older makefiles. If you are building with an older version of Metrowerks Code Warrior, you also may want to try starting with the project files found in an older version of Led (cuz the project file format has changed)

If you are using some other IDE which has never been tried with Led, you may want to contact Sophist Solutions. Or review the compiler bug workaround defines in LedConfig.h. Building a makefile/project file for your new IDE, and defining the appropriate set of #defines in LedConfig.h should be most of the work involved in using Led for some unsupported compiler/environment.

Building your own application using Led

How to proceed building Led with your project depends a lot on your situation.

If you have written no code yet

Then you are probably best of simply cloning one of the existing Led sample projects. Decide which project most closely fits what you are trying to do.

If what you want is more like a word processor, clone the LedIt! application.

If what you want is more like a programming editor, clone the LedLineIt! application.

If you are developing an ActiveX control, you may wish to contact Sophist Solutions about licencing the source code for ActiveLedIt!.

WARNING: If you do clone any of the sample/shareware applications/components, be sure to change the program name, CLSIDs, etc, to avoid conflict with the distributed Led-based shareware products.

If you already have an existing application, perhaps already using some other editor

Another common situation is that you've already written (part of) an application using some other editor (e.g CRichText, or CEditView). And you've found these text editors inadequate for your needs. Or perhaps you knew all along they would be, but used them to prototype, till you found an editor which did meet your needs.

In either case, Led should plug in rather easily. It supports most of the standard APIs defined by these classes. Most of what you need to do is to include the Led sources into your project (and include path). And to change the particular CView subclass you are using (say CEditView, for example) to the appropriate Led-based view (say Led_MFC_X for example).

To add the Led sources to your project, simply use the IDE to add the Led sources files you need to your project (which ones will depend on which Led classes you are using). And add the Led header file directory to your include path (what this is will depend on how you chose to layout your files).

And you will need to add the #defines to your C++ build flags to include qMac (if you are building for the Mac), or qWindows, if you are building for Windows. And define qDebug=0 for NODEBUG builds (assertions off), and qDebug=1 to have assertions turned on.

If this seems to vague, you may wish to look at one of the sample applications, or the MSVC/MFC AppWizard tutorial That will certainly eliminate most ambiguity.


Return to Led Page Return to Led Class Library Documentation Index
Last Updated 2001-10-19