By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,915 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,915 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
? 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

P: n/a
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

P: n/a
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

P: n/a
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.