470,815 Members | 1,740 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

HELP : visualC++ with STL roguewave => errorC2079(first' uses undefined class...

Hello,

I get this error while compiling with visualc++ and STL roguewave. With
STL microsoft everything work fine.

XXXData.cpp
f:\xxxxx\product\rw\rcb1.2.0\rm\include\rw\_pair.h (63) : error C2079:
'first' uses undefined class 'Node'
f:\xxxxx\product\rw\rcb1.2.0\rm\include\vector(404 ) : see
reference to class template instantiation 'std::pair<class Node,bool>'
being compiled
f:\xxxxxx\indexedvector.hpp(175) :
see reference to class template instantiation 'std::vector<struct
std::pair<class Node,bool>,class
std::allocator<struct std::pair<class Node,bool> >
' being compiled

f:\xxxxxx\node.hpp(147) :
see reference to class template instantiation 'xxx::IndexedVector<class
Node>' being compiled
Generating Code...
Error executing cl.exe.
=================================================
in f:\xxxxxx\indexedvector.hpp(175) : code is

static vector <pair <T, bool> > make_data (const vector <T>&
data);

// Data Members for Class Attributes
vector <pair <T, bool> > _data;
==================================================
What I understand as it's not possible to compile with visual c++ and
using roguewave STL this kind of code =>

class Tempo
{
...
std::vector<std::pair<Tempo,bool>> _data;

}

thanks

May 11 '06 #1
8 2357
ak*******@yahoo.fr wrote:
Hello,

I get this error while compiling with visualc++ and STL roguewave. With
STL microsoft everything work fine.

Post a complete example that shows your problem and someone might be
able to tell you what's wrong.

--
Ian Collins.
May 11 '06 #2
In fact the pb is due to this code => with visual c++ and using
roguewave STL this kind of code bellow gives an
f:\xxxxx\product\rw\rcb1.2.0\rm\include\rw\_pair.h (63) : error C2079:
'first' uses undefined class 'Tempo'.

With STL microsoft no problem. Unfortunately I must use roguewave STL.

class Tempo
{
...
std::vector<std::pair<Tempo,bool>> _data;

}

May 11 '06 #3
ak*******@yahoo.fr wrote:
In fact the pb is due to this code => with visual c++ and using
roguewave STL this kind of code bellow gives an
f:\xxxxx\product\rw\rcb1.2.0\rm\include\rw\_pair.h (63) : error C2079:
'first' uses undefined class 'Tempo'.

With STL microsoft no problem. Unfortunately I must use roguewave STL.

class Tempo
{
...
std::vector<std::pair<Tempo,bool>> _data;

}

So you are storing a class that contains a vector in a vector? Lucky
for you it doesn't compile!

--
Ian Collins.
May 11 '06 #4
ak*******@yahoo.fr wrote:
What I understand as it's not possible to compile with visual c++ and
using roguewave STL this kind of code =>

class Tempo
{
...
std::vector<std::pair<Tempo,bool>> _data;

}


Think: Tempo contains a vector of Tempos. Each of these tempos contain
a vector of Tempos. Each of these tempos then contain a vector of
Tempos... Where do we stop?

Either rethink your design or store pointers to dynamically allocated
Tempos. That way, you'll only have the Tempos you need.
Jonathan

May 12 '06 #5
? your answers are welcomed anyway....It is compiling/working without
problem using STL microsoft instead of STL Roguewave.
The idea is recursivity and I must reused existing code using Roguewave
:-(

May 12 '06 #6
ak*******@yahoo.fr wrote:
Jonathan Mcdougall wrote
akira2...@yahoo.fr wrote:
What I understand as it's not possible to compile with visual c++ and
using roguewave STL this kind of code =>

class Tempo
{
...
std::vector<std::pair<Tempo,bool>> _data;
}
Think: Tempo contains a vector of Tempos. Each of these tempos contain
a vector of Tempos. Each of these tempos then contain a vector of
Tempos... Where do we stop?

Either rethink your design or store pointers to dynamically allocated
Tempos. That way, you'll only have the Tempos you need.


? your answers are welcomed anyway....It is compiling/working without
problem using STL microsoft instead of STL Roguewave.
The idea is recursivity and I must reused existing code using Roguewave


Actually, my answer was plain wrong, just forget it. This:

# include <vector>
# include <utility>

class B
{
std::vector<std::pair<B, bool> > v;
};

compiles fine and looks good.

Perhaps if you post the exact code that fails to compile we'll be able
to help you.
Jonathan

May 12 '06 #7
Thanks Jonathan,

But are you using RogueWave STL? for me your code does
the same error with visual C++ and STL roguewave.

May 12 '06 #8
ak*******@yahoo.fr wrote:
I get this error while compiling with visualc++ and STL roguewave. With
STL microsoft everything work fine.


What version of VC++? VC++ 6.0 has poor template support. If you are
using VC++ 6.0, try upgrading your compiler.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
May 12 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Karl von Laudermann | last post: by
4 posts views Thread by Milan Krejci | last post: by
8 posts views Thread by stefman123 | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.