Thank you very much for your help.
The problems is following.
Complier:
Gcc Version 2.8.1
OS:
Solaris 2.6
Part Source Code:
class SeqNumSet //: public VIRTUAL Object
{
// DECLARE_MEMBERS(SeqNumSet);
public:
~SeqNumSet();
static SeqNumSet& instance()
{
if (m_instance.get() == 0)
{
// auto_ptr can only be changed by assignment from another auto_ptr
auto_ptr<SeqNumSet> tmp(new SeqNumSet);
m_instance = tmp;
}
return *(m_instance.get());
}
protected: // storer() functions for Object I/O
SeqNum &getSeqNum(int link, int uniqueTag);
const SeqNum &getSeqNum(int link, int uniqueTag) const;
private:
SeqNumSet(); // Singleton constructor must be private
SeqNumSet(const SeqNumSet& other); // defined but not implemented, so any
attempts to copy are stopped
SeqNumSet& operator =(SeqNumSet& other); // ditto
Dictionary sets; // From IntegerCache linkNum -> Dictionary(
// IC(uniqueTag) -> new SeqNum
//static auto_ptr<SeqNumSet> m_instance;
static auto_ptr<SeqNumSet> m_instance;
};
Error Message:
warning: ANSI C++ forbids declaration `auto_ptr' with no type
parse error before `;'
warning: `class SeqNumSet' only defines private constructors and has no
friends
In function `static class SeqNumSet & SeqNumSet::instance()':
(Each undeclared identifier is reported only once
for each function it appears in.)
`auto_ptr' undeclared (first use this function)
parse error before `>'
confused by earlier errors, bailing out
I don't know why it has this error when I porting CC to GCC.
I think the problems is the line:
static auto_ptr<SeqNumSet> m_instance;
Cound you mind giving some suggestion how to fix this error?
I am very appreciated for your help.
Ryan
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:kT6_b.376225$xy6.1944214@attbi_s02...
"Ryan Liu" <yy***@lucent.com> wrote... Now I am porting CC to GCC and I have some problems.
Would you mind tell me some document which have some description how to
port CC to GCC ??
I am not aware of any document for such porting, but if you have
problems with the code, why not post them/it here? We can help,
or direct you to a better newsgroup (depending on the problem).
Victor