[sword-devel] compiling SVN sample programs - ready to give up - please help

Chad Johnson chad.d.johnson at gmail.com
Sat Feb 10 13:29:26 MST 2007

I'm trying to compile the following program and I get the corresponding
output. I tried adding   using namespace sword;   but that did not help. I
was able to compile the examples using the makefile generated from
./autogen.sh and /usrinst.sh, but what must I do to get this program to
work? What must my makefile look like? Can I use bakefile? I'd really like
it working soon as I am integrating the SWORD modules with Aletheia (

chad at chadjohnson:/tmp/sword/examples/cmdline$ g++ -L/usr/lib
-I/usr/include:/usr/include/sword ciphercng.cpp
ciphercng.cpp:10:19: error: swmgr.h: No such file or directory
ciphercng.cpp: In function 'int main(int, char**)':
ciphercng.cpp:22: error: 'sword' has not been declared
ciphercng.cpp:22: error: expected `;' before 'manager'
ciphercng.cpp:23: error: 'ModMap' has not been declared
ciphercng.cpp:23: error: expected `;' before 'it'
ciphercng.cpp:24: error: 'it' was not declared in this scope
ciphercng.cpp:24: error: 'manager' was not declared in this scope
ciphercng.cpp:31: error: 'SWModule' was not declared in this scope
ciphercng.cpp:31: error: 'module' was not declared in this scope

 * This example demonstrates how to change the cipher key of a module
 *    The change is only in effect for this run.  This DOES NOT change the
 *    cipherkey in the module's .conf file.

#include <stdio.h>
#include <swmgr.h>
#include <iostream>

using namespace std;

int main(int argc, char **argv) {

    if (argc != 2) {
        fprintf(stderr, "usage: %s <modName>\n", *argv);

    sword::SWMgr manager;        // create a default manager that looks in
the current directory for mods.conf
    ModMap::iterator it;
    it = manager.Modules.find(argv[1]);

    if (it == manager.Modules.end()) {
        fprintf(stderr, "%s: couldn't find module: %s\n", *argv, argv[1]);

    SWModule *module = (*it).second;
    string key;

    cout << "\nPress [CTRL-C] to end\n\n";
    while (true) {
        cout << "\nModule text:\n";
        module->setKey("1jn 1:9");
        cout << "[ " << module->KeyText() << " ]\n";
        cout << (const char *)*module;
        cout << "\n\nEnter new cipher key: ";
        cin >> key;
        cout << "\nSetting key to: " << key;
        manager.setCipherKey(argv[1], (unsigned char *)key.c_str());

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20070210/fedda7a7/attachment.html 

More information about the sword-devel mailing list