[sword-devel] compiling SVN sample programs - ready to give up - please help
Chad Johnson
chad.d.johnson at gmail.com
Sun Feb 11 05:04:48 MST 2007
Ah, excellent - using g++ `pkg-config --cflags sword`
ciphercng.cpp`pkg-config --libs sword` solved it.
Changing the file /usr/lib/pkgconfig/sword.pc as noted at
https://launchpad.net/edgy-backports/+bug/65451 was also necessary.
On 2/10/07, Troy A. Griffitts <scribe at crosswire.org> wrote:
>
> Chad,
> The error:
>
> swmgr.h: No such file or directory
>
> tells me that you have not installed sword to your include path:
>
> I/usr/include:/usr/include/sword
>
> Actually, I'm not sure that syntax is legal. Try:
>
> I/usr/include -I/usr/include/sword
>
> Or better yet, try:
>
> g++ `pkg-config --cflags sword` ciphercng.cpp `pkg-config --libs sword`
>
> I've just updated the examples/classes directory in svn to work with the
> latest sword code and for the Makefile to use this build syntax, which
> should allow building outside the sword build system. My apologies for
> these not being up to date.
>
> -Troy.
>
>
> Chad Johnson wrote:
> > 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
> > ( aletheia.sourceforge.net <http://aletheia.sourceforge.net>).
> >
> > 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);
> > exit(-1);
> > }
> >
> > 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]);
> > exit(-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());
> > }
> >
> >
> > }
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > sword-devel mailing list: sword-devel at crosswire.org
> > http://www.crosswire.org/mailman/listinfo/sword-devel
> > Instructions to unsubscribe/change your settings at above page
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20070211/087bf05d/attachment.html
More information about the sword-devel
mailing list