guest7 0 Junior Poster

Hi,

I am getting the following error while compiling:

"Undefined symbols:
"main_class::binary(int, std::vector<int, std::allocator<int> >&, int)", referenced from:
main_class::identity(int, int, int)in test_sat.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [test] Error 1"

Following is the code :

int main_class::identity(int rowno, int size_row, int loop_iterate)
{
        /* Need to compute the universal set now */
        comb = pow(2,size_row)-1;
        int number, previous_count=51,fk=0;
        cout << "comb" << comb <<"\n" << endl;
        
       /* Intially the universal set is filled with 0's */
        for(int hfg=0; hfg<=comb; hfg++)
        {
                for(int ghj=0; ghj<size_row+1; ghj++)
                {
                        universal_row.push_back(0);
                }
                universal_column.push_back(universal_row);
                universal_row.clear();
        }

        /* We know the size of the universal set now in terms of rows = 0   to comb+1. Where the first row contains flip flops */

        for(int kl=0; kl<=comb; kl++)
        {
                number = kl;
                jml= (size_row);
                if(number < 0)
                        cout << "That is not a positive integer. \n";
                else
                {
                        binary(number,universal_column[kl],jml);
               }
       }
       return 0;
}

int binary(int number, vector<int> &ros1, int jmll)
{
        int remainder;
        if(number <= 1)
        {
                ros1[jmll] = number;
                jmll=jmll-1;
        }
        else
        {
                /* There is a right shift operator */
                remainder = number%2;
                ros1[jmll] = remainder;
                jmll=jmll-1;
                number = number >> 1;
                binary(number,ros1,jmll);
        }
        return 0;
}

I do not sure why i am getting the error.

Thanks