Hey all. Working on a Binary Tree of "N-order". For some reason I'm getting a fatal error while trying to compile my code. Let me know if you have any idea of what could be wrong, thanks.

I'm actually trying to model this off an implementation written in Java:
http://koders.com/java/fidAB3BF22D2F6F383D797E598C79B9DE16C02ECF9A.aspx?s=tree#L1

Error:
Undefined first referenced
symbol in file
main /opt/sfw/lib/gcc-lib/sparc-sun-solaris2.9/2.95.3/crt1.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

Code:

class BTNode
{
        /* Making an N-Order B-Tree */

        public:
           int order;           // Order of the tree
           int nKey;            // Number of keys stored in node
           int kArray[];        // Array where keys are held.
           BTNode *btnArray;    // array of refs to node
           bool isLeaf;         // is the node a leaf
           BTNode* parent;      // link to root node

           /* Class Functions */
           BTNode()
           {
                parent = NULL;
           }
           BTNode( int, BTNode* );
           bool isEmpty() const {return parent==NULL; }
           int insert( int );
           int extractKey( int );
           int getKey( int );
           void getTreeNode( int );
};
BTNode::BTNode ( int treeOrder, BTNode* treeParent)
{
        order = treeOrder;
        parent = treeParent;
        kArray[2 * treeOrder - 1];
        btnArray = new BTNode[2 * treeOrder];
        isLeaf = true;
}
int BTNode::extractKey( int keyIndex )
{
        int tempKey = getKey(keyIndex);

        for (int i = keyIndex; i < nKey; i++)
        {
           kArray[i] = kArray[i + 1];
           if (!isLeaf)
           {
                btnArray[i] = btnArray[i + 1];
           }
        }
        nKey--;
        return tempKey;
}

int BTNode::getKey( int keyIndex )
{
        return kArray[keyIndex];
}

Ignore this!

Please mark the thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.