From: e7677215@est.fib.upc.edu
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: gcc@gcc.gnu.org
Subject: Re: nurbs cannot be compiled with gcc 3.4
Date: Wed, 24 Nov 2004 16:30:00 -0000 [thread overview]
Message-ID: <1101310514.41a4aa3296c36@webmail.fib.upc.es> (raw)
In-Reply-To: <25ad01c4d210$782e33a0$2fb82997@bagio>
> 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.
next prev parent reply other threads:[~2004-11-24 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-24 10:27 e7677215
2004-11-24 12:44 ` Giovanni Bajo
2004-11-24 16:30 ` e7677215 [this message]
2004-11-24 16:34 ` Giovanni Bajo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1101310514.41a4aa3296c36@webmail.fib.upc.es \
--to=e7677215@est.fib.upc.edu \
--cc=gcc@gcc.gnu.org \
--cc=giovannibajo@libero.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).