public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* nurbs cannot be compiled with gcc 3.4
@ 2004-11-24 10:27 e7677215
  2004-11-24 12:44 ` Giovanni Bajo
  0 siblings, 1 reply; 4+ messages in thread
From: e7677215 @ 2004-11-24 10:27 UTC (permalink / raw)
  To: gcc

I need to install nurbs++-3.0.11 compiling it with gcc 3.4...., it can be
compiled with gcc 3.3 but it cannot be compiled with gcc 3.4, it returns a lot
of errors. I soved some problems of templates, but there's one I can't solve :

nurbs.cpp: In member function `BasicList<PLib::Point_nD<T, D> >
PLib::NurbsCurve<T, N>::tesselate(T, BasicList<T>*) const [with T = float, int
N = 3]':
f_nurbs.cpp:56:   instantiated from here
nurbs.cpp:5252: error: no matching function for call to
`BasicList<PLib::Point_nD<float, 3>
>::BasicList(BasicList<PLib::Point_nD<float, 3> >)'
../matrix/list.h:128: note: candidates are:
BasicList<T>::BasicList(BasicList<T>&) [with T = PLib::Point_nD<float, 3>]
nurbs.cpp: In member function `BasicList<PLib::Point_nD<T, D> >
PLib::NurbsCurve<T, N>::tesselate(T, BasicList<T>*) const [with T = float, int
N = 2]':


Any idea?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nurbs cannot be compiled with gcc 3.4
  2004-11-24 10:27 nurbs cannot be compiled with gcc 3.4 e7677215
@ 2004-11-24 12:44 ` Giovanni Bajo
  2004-11-24 16:30   ` e7677215
  0 siblings, 1 reply; 4+ messages in thread
From: Giovanni Bajo @ 2004-11-24 12:44 UTC (permalink / raw)
  To: e7677215; +Cc: gcc

e7677215@est.fib.upc.edu wrote:

> I need to install nurbs++-3.0.11 compiling it with gcc 3.4...., it
> can be compiled with gcc 3.3 but it cannot be compiled with gcc 3.4,
> it returns a lot of errors. I soved some problems of templates, but
> there's one I can't solve :
>
> nurbs.cpp: In member function `BasicList<PLib::Point_nD<T, D> >
> PLib::NurbsCurve<T, N>::tesselate(T, BasicList<T>*) const [with T =
> float, int N = 3]':
> f_nurbs.cpp:56:   instantiated from here
> nurbs.cpp:5252: error: no matching function for call to
> `BasicList<PLib::Point_nD<float, 3>
>>>> BasicList(BasicList<PLib::Point_nD<float, 3> >)'
> ../matrix/list.h:128: note: candidates are:
> BasicList<T>::BasicList(BasicList<T>&) [with T =
> PLib::Point_nD<float, 3>] nurbs.cpp: In member function
> `BasicList<PLib::Point_nD<T, D> > PLib::NurbsCurve<T,
> N>::tesselate(T, BasicList<T>*) const [with T = float, int N = 2]':


Looks like you are attemping to bind a temporary to a non-const reference. This
is invalid. More to the point, a copy constructor should always be declared as
A(A const &), not A(A&). BasicList<T>'s copy constructor seems to violate this.

BTW, when upgrading to 3.4, http://gcc.gnu.org/gcc-3.4/changes.html can be very
helpful.

Giovanni Bajo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nurbs cannot be compiled with gcc 3.4
  2004-11-24 12:44 ` Giovanni Bajo
@ 2004-11-24 16:30   ` e7677215
  2004-11-24 16:34     ` Giovanni Bajo
  0 siblings, 1 reply; 4+ messages in thread
From: e7677215 @ 2004-11-24 16:30 UTC (permalink / raw)
  To: Giovanni Bajo; +Cc: gcc

> e7677215@est.fib.upc.edu wrote:
>
> > I need to install nurbs++-3.0.11 compiling it with gcc 3.4...., it
> > can be compiled with gcc 3.3 but it cannot be compiled with gcc 3.4,
> > it returns a lot of errors. I soved some problems of templates, but
> > there's one I can't solve :
> >
> > nurbs.cpp: In member function `BasicList<PLib::Point_nD<T, D> >
> > PLib::NurbsCurve<T, N>::tesselate(T, BasicList<T>*) const [with T =
> > float, int N = 3]':
> > f_nurbs.cpp:56:   instantiated from here
> > nurbs.cpp:5252: error: no matching function for call to
> > `BasicList<PLib::Point_nD<float, 3>
> >>>> BasicList(BasicList<PLib::Point_nD<float, 3> >)'
> > ../matrix/list.h:128: note: candidates are:
> > BasicList<T>::BasicList(BasicList<T>&) [with T =
> > PLib::Point_nD<float, 3>] nurbs.cpp: In member function
> > `BasicList<PLib::Point_nD<T, D> > PLib::NurbsCurve<T,
> > N>::tesselate(T, BasicList<T>*) const [with T = float, int N = 2]':
>
>
> Looks like you are attemping to bind a temporary to a non-const reference.
> This
> is invalid. More to the point, a copy constructor should always be declared
> as
> A(A const &), not A(A&). BasicList<T>'s copy constructor seems to violate
> this.
>
> BTW, when upgrading to 3.4, http://gcc.gnu.org/gcc-3.4/changes.html can be
> very
> helpful.
>
> Giovanni Bajo
>
>

Well, I don't know what I'm doing wrong but I can't compile it. Here are the
functions :




from nurbs.cpp :

template <class T, int N>
BasicList< Point_nD<T,N> > NurbsCurve<T,N>::tesselate(T tolerance,BasicList<T>
*uk) const{
  BasicList< Point_nD<T,N> > list, list2 ;

  NurbsCurveArray<T,N> ca ;
  decompose(ca) ;

  if(ca.n()==1){
    // get the number of steps
    T u = 0 ;
    Point_nD<T,N> maxD(0) ;
    Point_nD<T,N> prev ;

    Vector< Point_nD<T,N> > ders(2) ;

    deriveAt(u,1,ders) ;

    prev = ders[1] ;

    int i ;
    for(i=1;i<11;++i){
      u = T(i)/T(10) ;
      deriveAt(u,1,ders) ;
      Point_nD<T,N> delta = ders[1]-prev ;
      delta.x() = absolute(delta.x()) ;
      delta.y() = absolute(delta.y()) ;
      delta.z() = absolute(delta.z()) ;
      maxD = maximumRef(maxD,delta) ;
      prev = ders[1] ;
    }

    const T sqr2 = T(1.414241527) ;

    int n = (int)rint(sqr2*norm(maxD)/tolerance) ;

    n+=2 ;
    if(n<3) n = 3 ;

    for(i=0;i<n;++i){
      u = (U[U.n()-deg_-1]-U[deg_])*T(i)/T(n-1) + U[deg_] ;
      list.add(pointAt(u)) ;
      if(uk)
	uk->add(u) ;
    }

    return list ;
  }
  else{
    for(int i=0;i<ca.n();++i){
      list2 = ca[i].tesselate(tolerance,uk) ; <------------ line 5252

      // remove the last point from the list to elliminate
      list.erase((BasicNode<Point_nD<T,N> >*)list.last()) ;
      list.addElements(list2) ;
    }
  }
  return list ;
}





from list.h :

template <class T>
BasicList<T>::BasicList(BasicList<T> const &a): BasicNode<T>() { <---- line 128
  first_ = last_ = 0 ;
  current = first_ ;
  *this = a ;
  nc = 0 ;
  n = 0 ;
}




What's wrong?

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: nurbs cannot be compiled with gcc 3.4
  2004-11-24 16:30   ` e7677215
@ 2004-11-24 16:34     ` Giovanni Bajo
  0 siblings, 0 replies; 4+ messages in thread
From: Giovanni Bajo @ 2004-11-24 16:34 UTC (permalink / raw)
  To: e7677215; +Cc: gcc

e7677215@est.fib.upc.edu wrote:

> from nurbs.cpp :
>
> template <class T, int N>
> BasicList< Point_nD<T,N> > NurbsCurve<T,N>::tesselate(T
tolerance,BasicList<T>
> *uk) const{

>       list2 = ca[i].tesselate(tolerance,uk) ; <------------ line 5252

Uhm, dunno at this point. We need the preprocessed source to help more.
Please follow the guidelines at http://gcc.gnu.org/bugs.html and submit a
bugreport in Bugzilla.

Thanks
-- 
Giovanni Bajo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-24 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-24 10:27 nurbs cannot be compiled with gcc 3.4 e7677215
2004-11-24 12:44 ` Giovanni Bajo
2004-11-24 16:30   ` e7677215
2004-11-24 16:34     ` Giovanni Bajo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).