Modules/Libraries

Joseph Colton josephcolton at gmail.com
Tue Jan 2 22:50:22 PST 2007


I would like to create a module for creating ODF documents using D.  I have
done this before in Perl and Python, but I was able to easily figure out how
to create modules there.

I currently have two files that I am trying to get to interface correctly.
Here is the first file called ooolib.d:

module ooolib;
class Calc
{
public:
        this()
        {
        }

        char[] echo(char[] name)
        {
                return name;
        }
}

The second file is called test.d:

import std.stdio;
import ooolib;
void main(char[][] args)
{
    Calc doc = new Calc();
    writefln(doc.echo("Hello World"));
}

For some reason I cannot seem to get them to work together.  I get a lot
errors that claim there are undefined references.  I am obviously missing
something, does anyone know what I am missing?


More information about the Digitalmars-d-learn mailing list