471,599 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

Porting CC to GCC

Hi All,

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 ??

Thank you very much.
Ryan
Jul 22 '05 #1
5 2761
"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
Jul 22 '05 #2
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

Jul 22 '05 #3
In article <c1********@netnews.proxy.lucent.com>,
"Ryan Liu" <yy***@lucent.com> wrote:
Hi All,

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 ??


That depends heavily on several things. You might want to post some of
small part of the actual code that your are having trouble with, along
with what your actual problems are.

Jul 22 '05 #4

In article <c1********@netnews.proxy.lucent.com>, "Ryan Liu" <yy***@lucent.com> wrote:

[snip]
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
[snip] I am very appreciated for your help.


Make sure that you've included <memory> somewhere earlier in the
code, and change all of the occurrences of "auto_ptr" to "std::auto_ptr".

Jul 22 '05 #5
Clark Cox wrote:
In article <c1********@netnews.proxy.lucent.com>, "Ryan Liu" <yy***@lucent.com> wrote:

[snip]
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


[snip]
I am very appreciated for your help.

Make sure that you've included <memory> somewhere earlier in the
code, and change all of the occurrences of "auto_ptr" to "std::auto_ptr".


Or change SeqNumSet::instance() to be:

SeqNumSet& SeqNumSet::instance()
{
static SeqNumSet m_instance;

return m_instance;
}

Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Edward | last post: by
2 posts views Thread by Anand | last post: by
4 posts views Thread by Chris Travers | last post: by
34 posts views Thread by subramanian100in | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.