OWLNext Home

~ Setting up C++ Builder 2010 to work with OWLNext ~


Home
About OWLNext
Getting started
Prerequisites
Patching
Building
Configuring
Tutorials
Documentation
Downloads
Articles
Links
Discussions


Hosted by
Get OWL Next at SourceForge.net. Fast, secure and Free Open Source software downloads

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.

OWLROOT is created/updated by running the OWLNext Setup but you have the option to set it manually, see: Setting up environment variables under Windows 2000/XP .

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:
Project Options

If you have OWLNext wizard addOn for CBuilder, you can go to File->New->Other and chose OWLNext project wich will start the Wizard to create an OWLNext project.

Setting project options

If you didn't use the OWLNext Wizard (ie, you are creating a project for pre-existing OWLNext files), just go to Project->Options and select the 'Base' Build configuration. After that just go to 'Directories and Conditionales' page:
Project Options
For the include directories add
$(OWLROOT)\include;
and for the library directories:
$(OWLROOT)\lib;

If you want to use dynamic linking, add the conditional define _OWLDLL.

If you want to use UNICODE version, add UNICODE to the conditional defines and also select _TCHAR maps to UNICODE.

If you want to use static linking for OWLNext library (which is recommended), go to C++ Linker page and set the Dynamic RTL to false:
Project Options
Finally, ensure that in the C++Compiler/General Compilation page the option Integer-sized enums is turned on.
Project Options



That's all!
If you want 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, 2010 by Codegear
      // 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 OWLNext Program"));
          }
      };
      
      int
      OwlMain(int /* argc */, char* /* argv */ [])
      {
        return TDrawApp().Run();
      }

Build and run the application. It should show an empty window with the caption Sample OWLNext 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:
Project Options



Last updated: 3 September 2009