Linkerfehler



  • typedef struct PointList_
    {
    int lng; /*Anzahl der Punkte*/
    double *xptr; /*x-Koordinaten*/
    double *yptr; /*y-Koordinaten*/
    double *wptr; /*Gewichte*/
    } *PointList;

    PointList NewPointList(int lng)
    {
    PointList pl;

    pl=(PointList) malloc(sizeof(struct PointList_));

    if(pl==0)
    {
    Message(FNAME,M_NO_MEM,ERROR);
    return NULL;
    }
    pl->lng=lng;
    pl->xptr=(double*)malloc(lngsizeof(double));
    pl->yptr=(double
    )malloc(lngsizeof(double));
    pl->wptr=(double
    )malloc(lng*sizeof(double));
    return pl;
    }

    int Rectification(double x1,double y1,double& x2,double& y2,int mode)
    {
    double R=GLOBAL_RECT_R;
    double f=GLOBAL_RECT_F;
    double xp=GLOBAL_RECT_XP;
    double yp=GLOBAL_RECT_YP;

    if (mode==RECT_MODE_ENTZERRUNG) {
    double Rsqr=Sqr(R);
    double dx =x1-xp,dy=y1-yp;
    double fac =1.0/(1.0-((Sqr(dx)+Sqr(dy))/Rsqr))f;
    x2=dx
    fac+xp;
    y2=dy*fac+yp;
    }
    else {
    }
    return 1;
    }

    PointList RectificatePointList(PointList pl)
    {
    int lng;
    PointList pl2=NewPointList(lng);
    for (int pnum=0;pnum<lng;pnum++)
    Rectification(pl->xptr[pnum],pl->yptr[pnum],
    &pl2->xptr[pnum],&pl2->yptr[pnum],RECT_MODE_ENTZERRUNG);
    return pl2;
    }

    Bei Verwendung der Funktion RectificatePointList innerhalb eines Projektes kommt es zu folgendem
    Kompilierfehler: cm_rect.o: In function RectificatePointList(ice::PointList\_*)': cm_rect.cpp:(.text+0x122): undefined reference toice::NewPointList(int)'
    Zum besseren Verständnis habe ich hier die Implementierung der NewPointList-Funktion und die Struktur des Datentyps PointList beigefügt
    (Die Struktur und die Funktion sind Bestandteil der ICE-C-Bibliothek für die Bildverarbeitung)
    Frage: Wer hat Ideen wie sich der Fehler beheben lässt?



  • Unleashed schrieb:

    (Die Struktur und die Funktion sind Bestandteil der ICE-C-Bibliothek für die Bildverarbeitung)

    Hast du die Bibliothek ordnungsgemäß mitgelinkt?



  • Nun ja, die Probleme sind teilweise behoben worden durch das Anpassen des "ultimativen" Makefiles...
    Allerdings treten gewisse Fehler immer noch auf (undefined reference to)...
    Würde es was bringen die X11 vorher zu linken und erst danach die anderen?
    Bzw. macht es einen Unterschied in welcher Reihenfolge die Bibliotheken gebunden werden?


Anmelden zum Antworten