|
|
- Setting up environment variables
For building OWLNext applications I recommend to set the environment variable OWLROOT
to point to the root folder where OWLNext files are installed.
An advantage of using this environment variable is that projects are easily transferred
from one computer to another without having to modify the project files.
See also: Setting up environment variables under Windows 2000/XP.
Note: OWLROOT should be set by OWLNext Setup Wizard.
- Setting up defaults for C++ Builder 2007
Start the IDE and make sure no project is open. From the menu Tools->Options open the Options dialog
and go to the Environment Options/C++ Options/Paths and Directories page:
For the include directories add
$(OWLROOT)\include;
and for the library directories:
$(OWLROOT)\lib;
- Starting a new OWLNext project
From the menu File->New->Other choose to create a new Console Application.
In the New Console Application dialog uncheck the Use VCL and Console Application checkboxes:
If you want to use static linking for OWLNext library (which is recommended), open the Project Options dialog
and go to the Linker/Linking page. Select the Base Build Configuration and uncheck the Dynamic RTL checkbox:
Also make sure that in the C++Compiler/General Compilation page the option Integer-sized enums is turned on.
To test if everything is set up correctly, open the created .cpp file for the project and replace it's
contents with the following code:
//-----------------------------------------------------------------------
// ObjectWindows - (C) Copyright 1991, 1994 by Borland International
// Tutorial application -- step01.cpp
//-----------------------------------------------------------------------
#include <owl/applicat.h>
#include <owl/framewin.h>
class TDrawApp : public TApplication
{
public:
TDrawApp() : TApplication() {}
void InitMainWindow()
{
SetMainWindow(new TFrameWindow(0, "Sample ObjectWindows Program"));
}
};
int
OwlMain(int /* argc */, char* /* argv */ [])
{
return TDrawApp().Run();
}
Build and run the application. It should show an empty window with the title
Sample ObjectWindows Program
- Adding empty OWLNext application project to the project repository
For easier creation of OWLNext application in the future, this sample project
can be added to the project repository. Simply delete the .cpp file, and select the
menu item Project->Add to Repository. In the dialog select appropriate category
and fill the Title, Description and Author fields:
|