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

Compiler error using C++ V6 Update 2

P: n/a
Hi,
I have a program that compiles fine when I use -
CC: Sun WorkShop 6 2000/04/07 C++ 5.1 .
But the exact same program when compiled with -
CC: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15
gives me an error - Error: The name exception is ambiguous, exception
and std::exception

What would have changed between these two compilers to suddenly have my
program throw this error?

The program looks something like this -
#include <it.h>
#include <exception>
using std::unexpected;

class testClass;
extern testClass *exception;
class testClass {
public :
class testClass *exp;
testClass(){
cout <<" I am in const";
exp=exception;
}

};

Any help or information would be very much appreciated.

Thanks and Regards,
Abhi

Apr 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Abhi wrote:
I have a program that compiles fine when I use -
CC: Sun WorkShop 6 2000/04/07 C++ 5.1 .
But the exact same program when compiled with -
CC: Sun WorkShop 6 update 2 C++ 5.3 2001/05/15
gives me an error - Error: The name exception is ambiguous, exception
and std::exception

What would have changed between these two compilers to suddenly have
my program throw this error?
Shouldn't you be asking Sun Microsystems about it? Or at least in the
newsgroup dedicated to Sun development tools or their OS?
The program looks something like this -
#include <it.h> ^^^^^^
And what's there?
#include <exception>
using std::unexpected;

class testClass;
extern testClass *exception;
class testClass {
public :
class testClass *exp;
testClass(){
cout <<" I am in const";
exp=exception;
}

};

Any help or information would be very much appreciated.


It _seems_ that somehow, somebody, somewhere (before that line), brought
the name 'std::exception' into the current scope (perhaps by means of the
'using' directive). In any case, you get a "name clash", so you could
either track down and fix the reason for 'exception' class name to be in
your scope or rename your pointer to avoid the conflict with the standard
class name.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.