hi nicolas ...
i've got a problem compiling msd:
tim@laptop ~/pd/externals/nusmuk/msd $ ../../grill/flext/build.sh pd gcc
make -f ../../grill/flext/buildsys/gnumake-sub.mak PLATFORM=lnx RTSYS=pd COMPILER=gcc BUILDPATH=../../grill/flext/buildsys/ PKGINFO=package.txt BUILDCLASS=ext TARGETMODE=release TARGETTYPE=single _build_
make[1]: Entering directory /home/tim/pd/externals/nusmuk/msd' g++ -c -msse -mfpmath=sse -ffast-math -DNDEBUG -O3 -march=pentium4 -pthread -fPIC -DFLEXT_SYS=2 -I/usr/local/src/pd/src -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp In file included from main.cpp:1: ../msd.h: In member function
void LinkList<N>::insert(Link<N>*)':
../msd.h:72: error: there are no arguments to begin' that depend on a template parameter, so a declaration of
begin' must be available
../msd.h:72: error: (if you use -fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../msd.h:72: error: there are no arguments to
end' that depend on a template parameter, so a declaration of end' must be available ../msd.h: In member function
void LinkList<N>::erase(Link<N>*)':
../msd.h:80: error: there are no arguments to begin' that depend on a template parameter, so a declaration of
begin' must be available
../msd.h:80: error: there are no arguments to end' that depend on a template parameter, so a declaration of
end' must be available
main.cpp: At global scope:
main.cpp:3: error: too few template-parameter-lists
main.cpp:3: error: too few template-parameter-lists
main.cpp:3: error: too few template-parameter-lists
main.cpp:3: error: too few template-parameter-lists
would be cool, if you could have a look into it ...
thanks ... tim
Hi Tim,
I think you must add the "-funroll-loops" flags in your flext compilation command... if it still doesn't work, try to upgrade to the last version of flext...
Cheers,
Nicolas
Tim Blechmann a écrit :
hi nicolas ...
i've got a problem compiling msd: tim@laptop ~/pd/externals/nusmuk/msd $ ../../grill/flext/build.sh pd gcc make -f ../../grill/flext/buildsys/gnumake-sub.mak PLATFORM=lnx RTSYS=pd COMPILER=gcc BUILDPATH=../../grill/flext/buildsys/ PKGINFO=package.txt BUILDCLASS=ext TARGETMODE=release TARGETTYPE=single _build_ make[1]: Entering directory
/home/tim/pd/externals/nusmuk/msd' g++ -c -msse -mfpmath=sse -ffast-math -DNDEBUG -O3 -march=pentium4 -pthread -fPIC -DFLEXT_SYS=2 -I/usr/local/src/pd/src -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp In file included from main.cpp:1: ../msd.h: In member function
void LinkList<N>::insert(Link<N>*)': ../msd.h:72: error: there are no arguments tobegin' that depend on a template parameter, so a declaration of
begin' must be available ../msd.h:72: error: (if you use-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../msd.h:72: error: there are no arguments to
end' that depend on a template parameter, so a declaration ofend' must be available ../msd.h: In member function
void LinkList<N>::erase(Link<N>*)': ../msd.h:80: error: there are no arguments tobegin' that depend on a template parameter, so a declaration of
begin' must be available ../msd.h:80: error: there are no arguments toend' that depend on a template parameter, so a declaration of
end' must be available main.cpp: At global scope: main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-listswould be cool, if you could have a look into it ...
thanks ... tim
I think you must add the "-funroll-loops" flags in your flext
well, unrolling loops might be a good idea, but it doesn't affect the treatment of the language ...
"-fpermissive" might make gcc accept the code, but i'd prefer to compile standard c++ compliant code ...
compilation command... if it still doesn't work, try to upgrade to the last version of flext...
latest cvs ..
t
Hi Tim, this seems to be a speciality of the gcc 3.4 compiler... i'll have to check for that - a bit later
best greetings, Thomas
Am 11.05.2005 um 13:01 schrieb Tim Blechmann:
hi nicolas ...
i've got a problem compiling msd: tim@laptop ~/pd/externals/nusmuk/msd $ ../../grill/flext/build.sh pd gcc make -f ../../grill/flext/buildsys/gnumake-sub.mak PLATFORM=lnx RTSYS=pd COMPILER=gcc BUILDPATH=../../grill/flext/buildsys/ PKGINFO=package.txt BUILDCLASS=ext TARGETMODE=release TARGETTYPE=single _build_ make[1]: Entering directory
/home/tim/pd/externals/nusmuk/msd' g++ -c -msse -mfpmath=sse -ffast-math -DNDEBUG -O3 -march=pentium4 -pthread -fPIC -DFLEXT_SYS=2 -I/usr/local/src/pd/src -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp In file included from main.cpp:1: ../msd.h: In member function
void LinkList<N>::insert(Link<N>*)': ../msd.h:72: error: there are no arguments tobegin' that depend on a template parameter, so a declaration of
begin' must be available ../msd.h:72: error: (if you use-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) ../msd.h:72: error: there are no arguments to
end' that depend on a template parameter, so a declaration ofend' must be available ../msd.h: In member function
void LinkList<N>::erase(Link<N>*)': ../msd.h:80: error: there are no arguments tobegin' that depend on a template parameter, so a declaration of
begin' must be available ../msd.h:80: error: there are no arguments toend' that depend on a template parameter, so a declaration of
end' must be available main.cpp: At global scope: main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-listswould be cool, if you could have a look into it ...
thanks ... tim
-- mailto:TimBlechmann@gmx.de ICQ: 96771783 http://www.mokabar.tk
latest mp3: kMW.mp3 http://mattin.org/mp3.html
latest cd: Goh Lee Kwang & Tim Blechmann: Drone http://www.geocities.com/gohleekwangtimblechmannduo/
After one look at this planet any visitor from outer space would say "I want to see the manager." William S. Burroughs
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Tim,
Thomas Grill a écrit :
Hi Tim, this seems to be a speciality of the gcc 3.4 compiler... i'll have to check for that - a bit later
Yes, I'm using 3.3 here and the begin() and end() methods works fine... These changes between 3.3 and 3.4 are listed here :
http://gcc.gnu.org/gcc-3.4/changes.html#cplusplus
I think there are two passages that interests us, First :
You must now use the |typename| and |template| keywords to disambiguate dependent names, as required by the C++ standard.
struct K {
typedef int mytype_t;
};
template <class T1> struct A { template <class T2> struct B { void callme(void); };
template <int N> void bar(void)
{
// Use 'typename' to tell the parser that T1::mytype_t names
// a type. This is needed because the name is dependent (in
// this case, on template parameter T1).
typename T1::mytype_t x;
x = 0;
}
};
template <class T> void template_func(void)
{
// Use 'template' to prefix member templates within
// dependent types (a has type A<T>, which depends on
// the template parameter T).
A<T> a;
a.template bar<0>();
// Use 'template' to tell the parser that B is a nested
// template class (dependent on template parameter T), and
// 'typename' because the whole A<T>::B<int> is
// the name of a type (again, dependent).
typename A<T>::template B<int> b;
b.callme();
}
void non_template_func(void) { // Outside of any template class or function, no names can be // dependent, so the use of the keyword 'typename' and 'template' // is not needed (and actually forbidden). A<K> a; a.bar<0>(); A<K>::B<float> b; b.callme(); }
But I've checked the code and template and typename seems well placed...
Second :
In a template definition, unqualified names will no longer find members of a dependent base (as specified by [temp.dep]/3 in the C++ standard). For example,
template <typename T> struct B {
int m;
int n;
int f ();
int g ();
};
int n;
int g ();
template <typename T> struct C : B<T> {
void h ()
{
m = 0; // error
f (); // error
n = 0; // ::n is modified
g (); // ::g is called
}
};
You must make the names dependent, e.g. by prefixing them with |this->|. Here is the corrected definition of |C<T>::h|,
template <typename T> void C<T>::h ()
{
this->m = 0;
this->f ();
this->n = 0
this->g ();
}
Perhaps if you just add this-> before begin() and end() at lines 72 & 80, it will works, but it seems too simple.. I see no other differences but I'm not a C++ specialist, has anyone got an idea?
Greetings,
Nicolas
hi nicolas, hi thomas ...
after this:
*** msd.h.~1.8.~ Mon May 9 16:12:19 2005 --- msd.h Wed May 11 16:22:19 2005
*** 69,75 **** public: void insert(Link<N> *l) { ! for(typename LinkList::iterator it = begin(); it != end(); ++it) if(*it == l) return; // not found -> add push_back(l); --- 69,76 ---- public: void insert(Link<N> *l) { ! for(typename LinkList::iterator it = this->begin(); ! it != this->end(); ++it) if(*it == l) return; // not found -> add push_back(l);
*** 77,89 ****
void erase(Link<N> *l)
{
! for(typename LinkList::iterator it = begin(); it != end(); ++it)
if(*it == l) {
// found
std::vector<Link<N> *>::erase(it);
return;
}
}
};
template<int N>
--- 78,93 ----
void erase(Link<N> *l)
{
! for(typename LinkList::iterator it = this->begin();
! it != this->end(); ++it)
if(*it == l) {
// found
std::vector<Link<N> *>::erase(it);
return;
}
}
};
template<int N>
the it almost compiled ...
the remaining problems are these:
g++ -c -msse -mfpmath=sse -ffast-math -DNDEBUG -O3 -funroll-loops -fpermissive -march=pentium4 -pthread -fPIC -DFLEXT_SYS=2 -I/usr/local/src/pd/src -I/usr/local/include/flext main.cpp -o pd-linux/release-single/main.opp main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists main.cpp:3: error: too few template-parameter-lists make[1]: *** [pd-linux/release-single/main.opp] Error 1 make[1]: Leaving directory `/home/tim/pd/externals/nusmuk/msd'
any idea?
thnx ... t
Hi,
There is a difference at instanciation too :
Using a name introduced by a typedef in a friend declaration or in an explicit instantiation is now rejected, as specified by the ISO C++ standard.
class A;
typedef A B;
class C {
friend class B; // error, no typedef name here
friend B; // error, friend always needs class/struct/enum
friend class A; // OK
};
template <int> class Q {}; typedef Q<0> R; template class R; // error, no typedef name here template class Q<0>; // OK
I think there is an error with the very last lines of the msd.h :
#define MSD(NAME,CLASS,N) \
...
\
typedef msdN<N> CLASS; \
FLEXT_NEW_V(NAME,CLASS)
try to instantiate in the main.cpp of msd with :
FLEXT_NEW_V("msd",template class msdN<1>)
instead of
MSD("msd",msd,1)
and to remove the FLEXT_NEW_V(NAME,CLASS) from the msd.h
Cheers,
Nicolas