[sword-devel] BCB 6.0 - compiling a new project - requirements

Jonathan Mickelson sword-devel@crosswire.org
Thu, 08 Apr 2004 19:11:52 -0400

This thread will archive the neccesary steps to compile your own Sword 
Project from scratch using BCB 6.0

Later, this material will be consolidated into a tutorial.

I am building a CLX project though either CLX or VCL (standard) may be used.

1) modify the Project Options dialog box.
    TAB "Directories/Conditional"

    Include Path =

    Library Path =

    Conditional Defines  (VERY IMPORTANT)

2) here is my simple program to display module names and descriptions on 
a form.
// download and install BibleCS 1.5.6.  This creates all the proper 
production directories.
// download some bible modules
// test that BibleCS is working properly
// Create a new project
// Add a memo component to the form (it's under the "Standard" tab)
// Create Form Events for OnDestroy and OnShow
// judiciously use the code below putting things in their proper place
// compile and run
// the form should appear with a list of module names and descriptions
#include <clx.h>    // used for CLX projects
#pragma hdrstop

#include "MySampleProject.h"
#include <string>
#include <swmgr.h>
#include <swconfig.h>
#include <markupfiltmgr.h>

#define WM_VERSE (WM_APP + 1995)
extern AnsiString startVerse;

using namespace sword;
//#pragma package(smart_init)
#pragma resource "*.xfm"

SWConfig *userPrefs;
SWMgr *mainmgr;
SWConfig *optionsconf;

TForm1 *Form1;
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
void __fastcall TForm1::FormDestroy(TObject *Sender)
    if (mainmgr)
        delete mainmgr;
    if (userPrefs)
        delete userPrefs;
    if (optionsconf)
        delete optionsconf;
void __fastcall TForm1::FormShow(TObject *Sender)
//    MyLibrary = new SWMgr(0, 0, true, new 

    ModMap::iterator it;
    SWModule *MyMod;

    optionsconf = new SWConfig("./options.conf");

        mainmgr = new SWMgr(0, 0, false, new MarkupFilterMgr(FMT_RTF, 
          userPrefs = 0;

        userPrefs = new SWConfig("./userprefs.conf");
        if ((mainmgr->config) && (userPrefs))
        (*(mainmgr->config)) += (*userPrefs);
    catch (...)

    if (!mainmgr->config)

    for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++)
        MyMod = (*it).second;
          if (!strcmp((*it).second->Type(), "Biblical Texts"))
// End of code