Errors in C++ code after upgrading to VS 2008 from VS 2003

I am having a app code written in C++,this code was written using VS 2003 IDE.This code was in working condition .Now I have upgraded it to the VS 2008 using MS VS upgradation wizard.When I compiled the source it thrown error as -

Error 2 error C2504: 'exception' : base class undefined ~\Mdlexception.h 10 MdlCommon

&

Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ~\log.h 61 MdlCommon

Please let me know cause of this error & solution.

Thanks.

Post the code.
This is part code from Mdlexception.h file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef mdlEXCEPTION_H
#define mdlEXCEPTION_H


#include <exception>
#include <string>


class mdlException : exception
{
public:

	mdlException(const std::string &file, int line);
	mdlException(const std::string &file, int line, int result);
	mdlException(const std::string &file, int line, int result, const std::string &message);

} ;


#endif 



Thanks
You don't need to derive from std::exception to define new exception types. Any type can be thrown.
By the way, I'm surprised VC++ 2003 compiled that without error.
Last edited on
ok I removed "exception" & now compilation errors related to this were not thrown.
Can you please give some inputs on second error message-

Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ~\log.h 61 MdlCommon

it is appearing in following code snippet-

1
2
3
4
5
6
7
8
9
class Log
{
public:
virtual ~Log();

private:
	//at this poit error is thrown
	Log(const &Log);
};


Thanks
I think your line 9:

class mdlException : exception

should probably be:

class mdlException : std::exception

(namespace std)
oh k..this issue is resolved now can I get some inputs on latest issue I posted in my last post.

Thanks
I think this:

Log(const &Log);

Should probably be this:

Log(const Log& log);
Topic archived. No new replies allowed.