[CLN-list] fixing undefined references

Michael Miller millermj at lemoyne.edu
Wed Mar 26 18:35:33 CET 2014


I've spent 5 hours trying to understand the reason for an undefined 
reference, so I'm asking for some help.

The code

--------------------
#include <cstdlib>
#include <gmp.h>
#include <cln/cln.h>

using namespace std;
using namespace cln;

const cl_univpoly_complex_ring CZ = find_univpoly_ring(cl_C_ring);

struct parameter { cl_N z0; cl_UP_N p(); };

int main(void) {
    cl_UP_N q=CZ->create(1);
    q.set_coeff(1, 1);
    q.set_coeff(0, -1);
    q.finalize();

    parameter param;
    param.z0=1;
    param.p()=q;

}
--------------------

produces the error message

--------------------
/tmp/ccZPl6fM.o: In function `main':
test.cpp:(.text+0xc6): undefined reference to `parameter::p()'
collect2: error: ld returned 1 exit status
--------------------

What am I doing wrong?


Note: replacing p() with p, which would make more sense to me, generates 
compiler errors.

Thanks,

Mike



More information about the CLN-list mailing list